Closed pba-report-isva closed 7 months ago
Thanks for bringing this to our attention .
Hello,
can you confirm these issues and let me know if you plan to fix them?
Thank you,
Best regards,
Yes, these will be fixed.
closed by #418
Hello,
can you provide the CVEs and publish the corresponding advisories in https://github.com/IBM-Security/ibmsecurity/security?
Thank you
The security bulletin has been published at https://www.ibm.com/support/pages/node/7147932.
Hi Pierre, we're looking into this.
This report has been previously deleted (by mistake?) -
Hello,
During the security assessment of ISVA, several vulnerabilities in ibmsecurity were reported to IBM in March 2023 (case TS012127268 and case TS015273561). A full report detailing these vulnerabilities has been provided to IBM, containing:
Additionally, as a result of this security assessment, several CVEs in ISVA have been published by IBM and additional non-public vulnerabilities will be patched in future releases of ISVA:
Regarding the ibmsecurity Python library, IBM confirmed on March 29, 2024 that these vulnerabilities should be directly reported via Github and that security patches will not be provided via IBM Support (which is the usual case when reporting vulnerabilities to IBM , because IBM PSIRT will redirect to IBM Support).
Following the analysis on ibmsecurity carried out in 2023, IBM confirmed the vulnerabilities in 2023 but stated that they could not manage the security vulnerabilities found in ibmsecurity in March 2024. Therefore, the present analysis was performed on an old version (ibmsecurity-2022.8.22.0 was the latest version in early 2023) but the current version is still vulnerable as shown below.
Please find attached vulnerabilities found in ibmsecurity.
Please credit the security researcher who found the vulnerability as Pierre Barre.
Best regards,
V-93 insecure communications 1/2
The package ibmsecurity has been partially audited as it provides the underlying APIs used by the Python scripts stored in the [REMOVE] directory.
Unfortunately, the security of the ibmsecurity package is very poor and by default, all the SSL/TLS connections to the remote ISVA server are configured in an insecure way.
The latest version of the ibmsecurity library (ibmsecurity-2022.8.22.0) has been downloaded using pip in order for the source code to be reviewed:
The invoke_* functions in the ibmsecurity library will use by default the _suppress_ssl_warning() method that will remove any security related to SSL/TLS. For example, for the previous [REMOVED] function, the method invoke_put() is defined in the file ibmsecurity/appliance/isamappliance.py, as shown below on line 402:
Figure 5 – ibmsecurity/appliance/isamappliance.py
The method _invoke_request() called on line 409 inside the invoke_put() method will disable any SSL/TLS security on line 334 by calling the method _suppress_ssl_warning() previously defined on line 45.
Figure 6 – ibmsecurity/appliance/isamappliance.py
The invoke_put() method called in [REMOVED] is defined on the line 402 of the ibmsecurity/appliance/isamappliance.py file. This method will then use the _invoke_request() method, defined on line 305. This _invoke_request() method will call the suppress_ssl_warning() method on line 334. The suppress_ssl_warning() method is defined on line 45: any security related to SSL/TLS will be then removed.
These methods defined in ibmsecurity/appliance/isamappliance.py are insecure:
In the ibmsecurity/appliance/isdsappliance.py Python file, we can find again the same suppress_ssl_warning() method which is also used by other methods (e.g. invoke_post_files() as shown below):
Figure 7 – ibmsecurity/appliance/isdsappliance.py
These methods are used everywhere in the ibmsecurity library to communicate with the remote ISVA infrastructure. 1162 calls to insecure methods have been identified:
Risk
The ibmsecurity Python library massively uses insecure methods to communicate with the remote ISVA infrastructure, with 1162 calls to insecure functions.
V-94 Insecure ibmsecurity library – insecure communications 2/2
The package ibmsecurity has been partially audited as it provides the underlying APIs used by the Python scripts stored in the [REMOVED] directory. Unfortunately, the security of the ibmsecurity package is very poor, and by default all the SSL/TLS connections to the remote ISVA server are insecure due to the insecure option (Verify=false) used with the methods provided by the requests module (to send HTTPS requests to the remote ISVA infrastructure). For example, the method invoke_post_snapshot_id() will use Verify=false in the HTTPS request on line 455 to disable any verification of the remote SSL certificate (in addition with the previous insecure _suppress_ssl_warning() method found in “V-93 Insecure ibmsecurity library – insecure communications 1/2”):
Figure 10 – ibmsecurity/appliance/isamappliance.py
Similar vulnerabilities can be found everywhere in the Python sources. For example, in the method invoke_request() inside ibmsecurity/appliance/isamappliance.py and invoke_get_file() inside ibmsecurity/ appliance/isdsappliance.py:
Figure 11 – ibmsecurity/appliance/isamappliance.py
Figure 12 – ibmsecurity/appliance/isdsappliance.py
Vulnerable functions identified in ibmsecurity/appliance/isdsappliance.py:
Vulnerable functions identified in ibmsecurity/appliance/isamappliance.py:
The vulnerable library can also be found in Github:
Figure 13 – https://github.com/IBM-Security/ibmsecurity/blob/master/ibmsecurity/appliance/isamappliance.py#L187
Risk
The ibmsecurity Python library massively uses insecure methods to communicate with the remote ISVA infrastructure, with 1162 calls to insecure functions.
V-95 Insecure ibmsecurity library – hardcoded passwords
It was observed that the ibmsecurity library contains hardcoded users and passwords:
Figure 14 – ibmsecurity/isam/web/reverse_proxy/federation_configuration.py
Similar vulnerabilities can be found in the source codes. For example, in the method invoke_request() inside ibmsecurity/appliance/isamappliance.py and invoke_get_file() inside ibmsecurity/ appliance/isdsappliance.py, we can find hardcoded credentials
Figure 15 – ibmsecurity/isam/web/reverse_proxy/oauth_configuration.py
Figure 16 – ibmsecurity/isam/web/reverse_proxy/aac_configuration.py
Risk Attacker can use hardcoded passwords to compromise installations.
V-96 Insecure ibmsecurity library – uninitialized variables
It was observed that the ibmsecurity library uses variables before they are initialized in:
Figure 17 – ibmsecurity/isam/aac/attribute_matchers.py
We can find similar vulnerability in ibmsecurity/isam/aac/risk_profiles.py:
Figure 18 – ibmsecurity/isam/aac/risk_profiles.py
Risk The Python code can crash.