PHP < 5.3.12 / 5.4.x < 5.4.2 CGI Query String Code Execution

high Nessus Network Monitor Plugin ID 6993
New! Plugin Severity Now Using CVSS v3

The calculated severity for Plugins has been updated to use CVSS v3 by default. Plugins that do not have a CVSS v3 score will fall back to CVSS v2 for calculating severity. Severity display preferences can be toggled in the settings dropdown.

Synopsis

The remote web server uses a version of PHP that is affected by a code execution vulnerability.


Description

PHP versions earlier than 5.3.12 / 5.4.2 are affected by the following vulnerabilities.

An error in the file 'sapi/cgi/cgi_main.c' can allow a remote attacker to obtain PHP source code from the web server or to potentially execute arbitrary code. In vulnerable configurations, PHP treats certain query string parameters as command line arguments including switches such as '-s', '-d', and '-c'.

Note that this vulnerability is exploitable only when PHP is used in CGI-based configurations. Apache with 'mod_php' is not an exploitable configuration.

Solution

Upgrade to PHP version 5.3.12 / 5.4.2 or later. A 'mod_rewrite' workaround is available as well.

See Also

https://bugs.php.net/bug.php?id=61910

http://eindbazen.net/2012/05/php-cgi-advisory-cve-2012-1823

http://www.php.net/archive/2012.php#id2012-05-03-1

http://www.php.net/ChangeLog-5.php#5.3.12

http://www.php.net/ChangeLog-5.php#5.4.2

Plugin Details

Severity: High

ID: 6993

Family: Web Servers

Published: 8/20/2013

Updated: 3/6/2019

Dependencies: 8728, 8682

Nessus ID: 58988

Risk Information

CVSS v2

Risk Factor: High

Base Score: 8.3

Temporal Score: 6.9

Vector: CVSS2#AV:N/AC:M/Au:N/C:C/I:P/A:P

Temporal Vector: CVSS2#E:F/RL:OF/RC:C

CVSS v3

Risk Factor: High

Base Score: 7

Temporal Score: 6.5

Vector: CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:L

Temporal Vector: CVSS:3.0/E:F/RL:O/RC:C

Vulnerability Information

CPE: cpe:2.3:a:php:php:*:*:*:*:*:*:*:*

Patch Publication Date: 5/3/2012

Vulnerability Publication Date: 5/3/2012

Exploitable With

CANVAS (CANVAS)

Metasploit (PHP CGI Argument Injection)

Reference Information

CVE: CVE-2012-1823

BID: 53388