CVE-2012-2311 Command injection in n/a
Remote attackers can execute arbitrary code on PHP CGI servers by injecting command-line options via query strings, requiring the server to run in CGI mode.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2012-2311?
CVE-2012-2311 is a high-severity command injection vulnerability in Php Php, published on 11 May 2012. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
sapi/cgi/cgi_main.c in PHP before 5.3.13 and 5.4.x before 5.4.3, when configured as a CGI script (aka php-cgi), does not properly handle query strings that contain a %3D sequence but no = (equals sign) character, which allows remote attackers to execute arbitrary code by placing command-line options in the query string, related to lack of skipping a certain php_getopt for the 'd' case. NOTE: this vulnerability exists because of an incomplete fix for CVE-2012-1823.
Weakness: CWE-89
Which versions are affected by CVE-2012-2311?
It affects 1 product.
Products include Php Php.
How do I fix CVE-2012-2311?
Upgrade to a fixed version.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2012-2311 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2012-2311 exists.
Public exploit code: 4 Exploit-DB entries.
Other vulnerabilities in Php Php
Sources
Also known as GHSA-9c8w-rvgj-w489.