Facebook Google Plus Twitter LinkedIn YouTube RSS Menu Search Resource - BlogResource - WebinarResource - ReportResource - Eventicons_066 icons_067icons_068icons_069icons_070

[R1] HP System Management Homepage (SMH) mod_smh_config.so AddCertsToTrustCfgList() Function X.509 Certificate Subject Common Name Handling Remote DoS

Low

Synopsis

While writing a Nessus plugin to detect the issues in HP's HPSBMU03546 advisory, Tenable discovered a vulnerability in the X.509 certificate handling within the AddCertsToTrustCfgList() function. Within mod_smh_config.so, the code tries to extract the common name in the subject of a certificate being processed. When a certificate is processed, the apr_strtok() function (included from Apache APR) tries to access address 0x3 if the subject common name is not present. The common name is used to derive the file name of the certificate to be stored in <SMH_INSTALLATION_DIR>/certs/. For example, if the subject common name is "echidna", echidna.pem is stored. In addition, certificates added for Trusted Management Servers are displayed as "common_name(common_name.pem)" on the Trusted Management Servers page in the SMH web GUI. To exploit this vulnerability, the 'Trust Mode' setting must be configured with 'Trust All', the 'IP Restricted login' setting must allow the attacker to access SMH, and the 'Kerberos Authorization' (Windows only) setting must be disabled. As such, the access complexity for this attack is rated 'High'.

According to HP, the AddCertsToTrustCfgList() function was reworked to better handle subject common name has '&' characters in it. The AddCertsToTrustCfgList() function in SMH 7.5.3 had problems extracting common names that contain a & character. We believe this is because the '&' character is used to separate the common name and email address in the subject line. SMH 7.5.3 searches for the first '&' character using apr_strtok() and uses the text up to (but not including) the '&' character as the certificate file name. If the common name contains a '&' character, only portion of the common name is extracted. In addition to the problem handling subject common name with '&' characters, the AddCertsToTrustCfgList() function in SMH 7.5.3 has the vulnerability that can be exploited when processing a user-supplied certificate that doesn't have a subject common name. For example, imagine a certificate with a subject line "Subject: C=XX, L=Default City, O=Echidna Company Ltd". The code sXEName = strstr(x509->name,"CN=") will return NULL, and apr_strtok() is passed with an address of 3 in the sXEName parameter, leading to an address access violation. The same crash does not happen in 7.5.4.3, so at some point HP's enhancements to SMH fixed this issue as well. Based on the analysis, this is a flaw in the AddCertsToTrustCfgList() function which doesn't check for presence of a subject common name and passes an invalid address to the Apache APR function apr_strtok().

Tenable generated a NASL PoC against SMH 7.5.3.1, that we will not be sharing, running under the following configuration:

  • SMH 7.5.3.1 running on a 32-bit Windows 2008 Server SP2
  • "Trusted By All" is configured
  • IP Restricted Login is not configured
  • Kerberos Authorization is not configured

The DoS attack can be produced in two ways to demonstrate the issue:

  1. $ nasl -WaXt 7.5.3.1 target> hpsmh_7_5_3_1_null_cn.dos.nasl
  2. Import cert_null_cn.pem under Settings -> SMH -> Security -> Trusted Management Server -> Add Certificate -> Import Certificate Data

Solution

Upgrade SMH to version 7.5.4.3, or later, to address this vulnerability.

Disclosure Timeline

2016-04-06 - Issue discovered
2016-04-07 - Vendor informed via [email protected]
2016-04-08 - Vendor responds, assigns PSRT110078
2016-04-13 - Discussion of issues re: prior patches, and new DoS
2016-04-14 - Continued discussion of new DoS over next 8 days
2016-04-22 - Vendor confirms no further action needed, Tenable agrees
2016-05-04 - Groaning over "May the fourth" jokes
2016-05-05 - Advisory drafted

All information within TRA advisories is provided “as is”, without warranty of any kind, including the implied warranties of merchantability and fitness for a particular purpose, and with no guarantee of completeness, accuracy, or timeliness. Individuals and organizations are responsible for assessing the impact of any actual or potential security vulnerability.

Tenable takes product security very seriously. If you believe you have found a vulnerability in one of our products, we ask that you please work with us to quickly resolve it in order to protect customers. Tenable believes in responding quickly to such reports, maintaining communication with researchers, and providing a solution in short order.

For more details on submitting vulnerability information, please see our Vulnerability Reporting Guidelines page.

If you have questions or corrections about this advisory, please email [email protected]

Risk Information

Tenable Advisory ID: TRA-2016-14
Credit:
Tenable Network Security
CVSSv2 Base / Temporal Score:
2.6 / 2.1
CVSSv2 Vector:
(AV:N/AC:H/Au:N/C:N/I:N/A:P/E:F/RL:OF/RC:C)
Affected Products:
HP System Management Homepage 7.5.3.1
Risk Factor:
Low
Additional Keywords:
PSRT110078

Advisory Timeline

2016-05-05 - [R1] Initial release