Vulnerability Note VU#735364

HP System Management Homepage contains a command injection vulnerability

Original Release date: 11 Jun 2013 | Last revised: 24 Sep 2013

Overview

HP System Management Homepage contains a command injection vulnerability (CWE-77) that may result in arbitrary command execution and privilege escalation.

Description

Markus Wulftange from Daimler TSS reports:

      The vulnerability is located in the `ginkgosnmp.inc` PHP file in the `C:\hp\hpsmh\data\smhutil` or `/opt/hp/hpsmh/data/smhutil` directory, respectively. Inside the `ginkgosnmp.inc` script, the last path segment of the current requested URL path is used in a `exec` call without proper escaping:

      $tempfilename = "$sessiondir/" . substr($_SERVER["SCRIPT_URL"], 1 + strrpos($_SERVER["SCRIPT_URL"], '/')) . uniqid(".", true) . time() . ".txt";

      [...]

      if("Linux" == PHP_OS)
      $cmd = "../../webapp-data/webagent/csginkgo -f$tempfilename";
      else
      {
      $windrive = substr( $_SERVER["WINDIR"], 0, 2 );
      $cmd = "$windrive\\hp\\hpsmh\\data\\smhutil\\csginkgo.exe -f$tempfilename";
      }

      exec( $cmd, $out );

      This script is reachable via the URL path `https://<host>:2381/smhutil/snmpchp.php.en`. Due to [Apache’s *MultiViews*] [2] it can also be referenced with any additional path segments after the `snmpchp.php.en` segment: `https://<host>:2381/smhutil/snmpchp.php.en/foo/bar` still triggers `https://<host>:2381/smhutil/snmpchp.php.en` but `$_SERVER["SCRIPT_URL"]` is `https://<host>:2381/smhutil/snmpchp.php.en/foo/bar`. This can be exploited as follows:

      https://<host>:2381/smhutil/snmpchp.php.en/&&<cmd>&&echo (full file name)
      https://<host>:2381/smhutil/snmpchp.php/&&<cmd>&&echo (without "en" language indicator)
      https://<host>:2381/smhutil/snmpchp/&&<cmd>&&echo (without any file name extension)

      Besides the path segment separator `/`, the characters `<`, `>`, and `|` are also not allowed, which makes exploiting this vulnerability a little hard.

      https://<host>:2381/smhutil/snmpchp/&&whoami&&echo

Impact

A remote authenticated user may be able to run arbitrary commands on the HP System Management Homepage server.

Solution

Apply an Update
HP System Management Homepage (SMH) version 7.2.2 and later address this vulnerability. If you cannot upgrade for whatever reason, please consider the following workarounds.

Restrict Network Access

As a general good security practice, only allow connections from trusted hosts and networks. Restricting access would prevent an attacker from connecting to the service from a blocked network location.

Vendor Information (Learn More)

VendorStatusDate NotifiedDate Updated
Hewlett-Packard CompanyAffected19 Apr 201310 Jun 2013
If you are a vendor and your product is affected, let us know.

CVSS Metrics (Learn More)

Group Score Vector
Base 9.0 AV:N/AC:L/Au:S/C:C/I:C/A:C
Temporal 8.5 E:H/RL:W/RC:C
Environmental 6.4 CDP:ND/TD:M/CR:ND/IR:ND/AR:ND

References

Credit

Thanks to Markus Wulftange from Daimler TSS for reporting this vulnerability.

This document was written by Jared Allar.

Other Information

  • CVE IDs: CVE-2013-3576
  • Date Public: 10 Jun 2013
  • Date First Published: 11 Jun 2013
  • Date Last Updated: 24 Sep 2013
  • Document Revision: 18

Feedback

If you have feedback, comments, or additional information about this vulnerability, please send us email.