ID CVE-2012-2335
Summary php-wrapper.fcgi does not properly handle command-line arguments, which allows remote attackers to bypass a protection mechanism in PHP 5.3.12 and 5.4.2 and execute arbitrary code by leveraging improper interaction between the PHP sapi/cgi/cgi_main.c component and a query string beginning with a +- sequence.
References
Vulnerable Configurations
  • PHP 5.3.12
    cpe:2.3:a:php:php:5.3.12
  • PHP 5.4.2
    cpe:2.3:a:php:php:5.4.2
CVSS
Base: 7.5 (as of 11-05-2012 - 12:12)
Impact:
Exploitability:
CWE CWE-264
CAPEC
  • Accessing, Modifying or Executing Executable Files
    An attack of this type exploits a system's configuration that allows an attacker to either directly access an executable file, for example through shell access; or in a possible worst case allows an attacker to upload a file and then execute it. Web servers, ftp servers, and message oriented middleware systems which have many integration points are particularly vulnerable, because both the programmers and the administrators must be in synch regarding the interfaces and the correct privileges for each interface.
  • Leverage Executable Code in Non-Executable Files
    An attack of this type exploits a system's trust in configuration and resource files, when the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high. The attack can be directed at a client system, such as causing buffer overrun through loading seemingly benign image files, as in Microsoft Security Bulletin MS04-028 where specially crafted JPEG files could cause a buffer overrun once loaded into the browser. Another example targets clients reading pdf files. In this case the attacker simply appends javascript to the end of a legitimate url for a pdf (http://www.gnucitizen.org/blog/danger-danger-danger/) http://path/to/pdf/file.pdf#whatever_name_you_want=javascript:your_code_here The client assumes that they are reading a pdf, but the attacker has modified the resource and loaded executable javascript into the client's browser process. The attack can also target server processes. The attacker edits the resource or configuration file, for example a web.xml file used to configure security permissions for a J2EE app server, adding role name "public" grants all users with the public role the ability to use the administration functionality. The server trusts its configuration file to be correct, but when they are manipulated, the attacker gains full control.
  • Blue Boxing
    This type of attack against older telephone switches and trunks has been around for decades. A tone is sent by an adversary to impersonate a supervisor signal which has the effect of rerouting or usurping command of the line. While the US infrastructure proper may not contain widespread vulnerabilities to this type of attack, many companies are connected globally through call centers and business process outsourcing. These international systems may be operated in countries which have not upgraded Telco infrastructure and so are vulnerable to Blue boxing. Blue boxing is a result of failure on the part of the system to enforce strong authorization for administrative functions. While the infrastructure is different than standard current applications like web applications, there are historical lessons to be learned to upgrade the access control for administrative functions.
  • Restful Privilege Elevation
    Rest uses standard HTTP (Get, Put, Delete) style permissions methods, but these are not necessarily correlated generally with back end programs. Strict interpretation of HTTP get methods means that these HTTP Get services should not be used to delete information on the server, but there is no access control mechanism to back up this logic. This means that unless the services are properly ACL'd and the application's service implementation are following these guidelines then an HTTP request can easily execute a delete or update on the server side. The attacker identifies a HTTP Get URL such as http://victimsite/updateOrder, which calls out to a program to update orders on a database or other resource. The URL is not idempotent so the request can be submitted multiple times by the attacker, additionally, the attacker may be able to exploit the URL published as a Get method that actually performs updates (instead of merely retrieving data). This may result in malicious or inadvertent altering of data on the server.
  • Target Programs with Elevated Privileges
    This attack targets programs running with elevated privileges. The attacker would try to leverage a bug in the running program and get arbitrary code to execute with elevated privileges. For instance an attacker would look for programs that write to the system directories or registry keys (such as HKLM, which stores a number of critical Windows environment variables). These programs are typically running with elevated privileges and have usually not been designed with security in mind. Such programs are excellent exploit targets because they yield lots of power when they break. The malicious user try to execute its code at the same level as a privileged system call.
  • Manipulating Input to File System Calls
    An attacker manipulates inputs to the target software which the target software passes to file system calls in the OS. The goal is to gain access to, and perhaps modify, areas of the file system that the target software did not intend to be accessible.
Access
VectorComplexityAuthentication
NETWORK LOW NONE
Impact
ConfidentialityIntegrityAvailability
PARTIAL PARTIAL PARTIAL
nessus via4
  • NASL family CGI abuses
    NASL id PHP_5_4_3.NASL
    description According to its banner, the version of PHP installed on the remote host is 5.4.x earlier than 5.4.3. It is, therefore, potentially affected the following vulnerabilities : - The fix for CVE-2012-1823 does not completely correct the CGI query parameter vulnerability. Disclosure of PHP source code and code execution are still possible. Note that this vulnerability is exploitable only when PHP is used in CGI-based configurations. Apache with 'mod_php' is not an exploitable configuration. (CVE-2012-2311, CVE-2012-2335, CVE-2012-2336) - An unspecified buffer overflow exists related to the function 'apache_request_headers'. (CVE-2012-2329)
    last seen 2019-02-21
    modified 2018-07-24
    plugin id 59057
    published 2012-05-09
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=59057
    title PHP 5.4.x < 5.4.3 Multiple Vulnerabilities
  • NASL family SuSE Local Security Checks
    NASL id SUSE_APACHE2-MOD_PHP5-8133.NASL
    description PHP5 was updated with incremental fixes to the previous update : - Additional unsafe cgi wrapper scripts are also fixed now. (CVE-2012-2335) - Even more commandline option handling is filtered, which could lead to crashes of the php interpreter. (CVE-2012-2336)
    last seen 2019-02-21
    modified 2012-06-11
    plugin id 59445
    published 2012-06-11
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=59445
    title SuSE 10 Security Update : PHP5 (ZYPP Patch Number 8133)
  • NASL family SuSE Local Security Checks
    NASL id SUSE_11_APACHE2-MOD_PHP5-120518.NASL
    description PHP5 was updated with incremental fixes to the previous update : - Additional unsafe cgi wrapper scripts are also fixed now. (CVE-2012-2335) - Even more commandline option handling is filtered, which could lead to crashes of the php interpreter. (CVE-2012-2336)
    last seen 2019-02-21
    modified 2013-10-25
    plugin id 64100
    published 2013-01-25
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=64100
    title SuSE 11.1 Security Update : PHP5 (SAT Patch Number 6316)
  • NASL family CGI abuses
    NASL id PHP_CGI_REMOTE_CODE_EXECUTION.NASL
    description The PHP installation on the remote web server contains a flaw that could allow a remote attacker to pass command-line arguments as part of a query string to the PHP-CGI program. This could be abused to execute arbitrary code, reveal PHP source code, cause a system crash, etc.
    last seen 2019-02-21
    modified 2018-07-25
    plugin id 70728
    published 2013-11-01
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=70728
    title Apache PHP-CGI Remote Code Execution
  • NASL family Gentoo Local Security Checks
    NASL id GENTOO_GLSA-201209-03.NASL
    description The remote host is affected by the vulnerability described in GLSA-201209-03 (PHP: Multiple vulnerabilities) Multiple vulnerabilities have been discovered in PHP. Please review the CVE identifiers referenced below for details. Impact : A remote attacker could execute arbitrary code with the privileges of the process, cause a Denial of Service condition, obtain sensitive information, create arbitrary files, conduct directory traversal attacks, bypass protection mechanisms, or perform further attacks with unspecified impact. Workaround : There is no known workaround at this time.
    last seen 2019-02-21
    modified 2018-07-12
    plugin id 62236
    published 2012-09-24
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=62236
    title GLSA-201209-03 : PHP: Multiple vulnerabilities
  • NASL family Web Servers
    NASL id HPSMH_7_2_1_0.NASL
    description According to the web server's banner, the version of HP System Management Homepage (SMH) hosted on the remote web server is a version prior to 7.2.1.0. It is, therefore, affected by the following vulnerabilities : - An information disclosure vulnerability, known as BEAST, exists in the SSL 3.0 and TLS 1.0 protocols due to a flaw in the way the initialization vector (IV) is selected when operating in cipher-block chaining (CBC) modes. A man-in-the-middle attacker can exploit this to obtain plaintext HTTP header data, by using a blockwise chosen-boundary attack (BCBA) on an HTTPS session, in conjunction with JavaScript code that uses the HTML5 WebSocket API, the Java URLConnection API, or the Silverlight WebClient API. (CVE-2011-3389) - The utility 'apachectl' can receive a zero-length directory name in the LD_LIBRARY_PATH via the 'envvars' file. A local attacker with access to that utility could exploit this to load a malicious Dynamic Shared Object (DSO), leading to arbitrary code execution. (CVE-2012-0883) - Numerous, unspecified errors could allow remote denial of service attacks. (CVE-2012-2110, CVE-2012-2329, CVE-2012-2336, CVE-2013-2357, CVE-2013-2358, CVE-2013-2359, CVE-2013-2360) - The fix for CVE-2012-1823 does not completely correct the CGI query parameter vulnerability. Disclosure of PHP source code and code execution are still possible. Note that this vulnerability is exploitable only when PHP is used in CGI-based configurations. Apache with 'mod_php' is not an exploitable configuration. (CVE-2012-2311, CVE-2012-2335) - Unspecified errors exist that could allow unauthorized access. (CVE-2012-5217, CVE-2013-2355) - Unspecified errors exist that could allow disclosure of sensitive information. (CVE-2013-2356, CVE-2013-2363) - An unspecified error exists that could allow cross-site scripting attacks. (CVE-2013-2361) - Unspecified errors exist that could allow a local attacker to cause denial of service conditions. (CVE-2013-2362, CVE-2013-2364) - An as-yet unspecified vulnerability exists that could cause a denial of service condition. (CVE-2013-4821)
    last seen 2019-02-21
    modified 2018-11-15
    plugin id 69020
    published 2013-07-23
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=69020
    title HP System Management Homepage < 7.2.1.0 Multiple Vulnerabilities (BEAST)
  • NASL family SuSE Local Security Checks
    NASL id OPENSUSE-2012-288.NASL
    description The patch for CVE-2012-1823 was incomplete, this update fixes the remaining bits (CVE-2012-2335, CVE-2012-2336)
    last seen 2019-02-21
    modified 2018-06-29
    plugin id 74630
    published 2014-06-13
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=74630
    title openSUSE Security Update : php5 (openSUSE-2012-288)
  • NASL family SuSE Local Security Checks
    NASL id SUSE_11_APACHE2-MOD_PHP53-120618.NASL
    description PHP5 was updated with incremental fixes to the previous update. - Additional unsafe cgi wrapper scripts are also fixed now. (CVE-2012-2335) - Even more commandline option handling is filtered, which could lead to crashes of the php interpreter. (CVE-2012-2336) - heap-based buffer overflow in php's phar extension. (CVE-2012-2386) - The crypt() implementation ignored wide characters, leading to shorter effective password lengths. Note: With this update applied affected passwords will no longer work and need to be set again. (CVE-2012-2143)
    last seen 2019-02-21
    modified 2013-10-25
    plugin id 64104
    published 2013-01-25
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=64104
    title SuSE 11.2 Security Update : PHP5 (SAT Patch Number 6440)
  • NASL family Ubuntu Local Security Checks
    NASL id UBUNTU_USN-1481-1.NASL
    description It was discovered that PHP incorrectly handled certain Tidy::diagnose operations on invalid objects. A remote attacker could use this flaw to cause PHP to crash, leading to a denial of service. (CVE-2012-0781) It was discovered that PHP incorrectly handled certain multi-file upload filenames. A remote attacker could use this flaw to cause a denial of service, or to perform a directory traversal attack. (CVE-2012-1172) Rubin Xu and Joseph Bonneau discovered that PHP incorrectly handled certain Unicode characters in passwords passed to the crypt() function. A remote attacker could possibly use this flaw to bypass authentication. (CVE-2012-2143) It was discovered that a Debian/Ubuntu specific patch caused PHP to incorrectly handle empty salt strings. A remote attacker could possibly use this flaw to bypass authentication. This issue only affected Ubuntu 10.04 LTS and Ubuntu 11.04. (CVE-2012-2317) It was discovered that PHP, when used as a stand alone CGI processor for the Apache Web Server, did not properly parse and filter query strings. This could allow a remote attacker to execute arbitrary code running with the privilege of the web server, or to perform a denial of service. Configurations using mod_php5 and FastCGI were not vulnerable. (CVE-2012-2335, CVE-2012-2336) Alexander Gavrun discovered that the PHP Phar extension incorrectly handled certain malformed TAR files. A remote attacker could use this flaw to perform a denial of service, or possibly execute arbitrary code. (CVE-2012-2386). Note that Tenable Network Security has extracted the preceding description block directly from the Ubuntu security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen 2019-02-21
    modified 2018-12-01
    plugin id 59603
    published 2012-06-20
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=59603
    title Ubuntu 8.04 LTS / 10.04 LTS / 11.04 / 11.10 / 12.04 LTS : php5 vulnerabilities (USN-1481-1)
  • NASL family Mandriva Local Security Checks
    NASL id MANDRIVA_MDVSA-2012-068.NASL
    description A vulnerability has been found and corrected in php(-cgi) : PHP-CGI-based setups contain a vulnerability when parsing query string parameters from php files. A remote unauthenticated attacker could obtain sensitive information, cause a denial of service condition or may be able to execute arbitrary code with the privileges of the web server (CVE-2012-1823). The updated packages have been patched to correct this issue. Update : It was discovered that the previous fix for the CVE-2012-1823 vulnerability was incomplete (CVE-2012-2335, CVE-2012-2336). The updated packages provides the latest version (5.3.13) which provides a solution to this flaw.
    last seen 2019-02-21
    modified 2019-01-02
    plugin id 59010
    published 2012-05-07
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=59010
    title Mandriva Linux Security Advisory : php (MDVSA-2012:068-1)
  • NASL family CGI abuses
    NASL id PHP_5_3_13.NASL
    description According to its banner, the version of PHP installed on the remote host is 5.3.x earlier than 5.3.13 and, as such, is potentially affected by a remote code execution and information disclosure vulnerability. The fix for CVE-2012-1823 does not completely correct the CGI query vulnerability. Disclosure of PHP source code and code execution via query parameters are still possible. Note that this vulnerability is exploitable only when PHP is used in CGI-based configurations. Apache with 'mod_php' is not an exploitable configuration.
    last seen 2019-02-21
    modified 2018-09-17
    plugin id 59056
    published 2012-05-09
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=59056
    title PHP 5.3.x < 5.3.13 CGI Query String Code Execution
refmap via4
cert-vn VU#520827
hp
  • HPSBMU02900
  • SSRT100992
misc
secunia 49014
suse
  • SUSE-SU-2012:0721
  • SUSE-SU-2012:0840
xf php-phpwrapperfcgi-code-exec(75652)
Last major update 23-07-2013 - 05:39
Published 11-05-2012 - 06:15
Last modified 04-01-2018 - 21:29
Back to Top