CVE-2012-2311
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…
- Published
- Updated
- Reserved
- Assigned by
- redhat
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.
Public exploit
An exploit or proof of concept is public: anyone can try it against an unpatched system. The public collections list 4 Exploit-DB entries for it.
Exploit-DB4 entries
- Apache + PHP < 5.3.12 / < 5.4.2 - Remote Code Execution + Scanner (Exploit-DB entry) (opens in a new tab)
EDB-ID 29316remote, phppublished 31 Oct 2013Not verified
- Apache + PHP < 5.3.12 / < 5.4.2 - cgi-bin Remote Code Execution (Exploit-DB entry) (opens in a new tab)
EDB-ID 29290remote, phppublished 29 Oct 2013Verified
- PHP < 5.3.12 / < 5.4.2 - CGI Argument Injection (Exploit-DB entry) (opens in a new tab)
EDB-ID 18836remote, phppublished 5 May 2012Verified
- PHP 5.3.12/5.4.2 - CGI Argument Injection (Metasploit) (Exploit-DB entry) (opens in a new tab)
EDB-ID 18834remote, phppublished 4 May 2012Verified
Modules, templates and exploits as listed by the Metasploit Framework (BSD-3-Clause), ProjectDiscovery's Nuclei templates (MIT) and the Exploit Database (GPLv2), read once a day. Where the data comes from
Timeline
ID reserved
By redhat
- 22 days later
· 22 days later
Published
- 12 years later
· 12 years later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| NVDNVD · Modified | 2.0 | High7.5 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
- EPSS (exploitation in 30 days)
- 69.3% · top 0.6% of all CVEs (9 Nov 2026)
The list uses the assigner's score when there is one, then CISA's, then NVD's: High 7.5.
Weakness
Affected products
n/a
- affected n/a
References (17)
- SSRT100856 (opens in a new tab)vendor-advisoryx_refsource_HPx_transferred
- SUSE-SU-2012:0604 (opens in a new tab)vendor-advisoryx_refsource_SUSEx_transferred
- 1027022 (opens in a new tab)vdb-entryx_refsource_SECTRACKx_transferred
- openSUSE-SU-2012:0590 (opens in a new tab)vendor-advisoryx_refsource_SUSEx_transferred
- https://bugs.php.net/patch-display.php?bug_id=61910&patch=cgi.diff-fix-check.patch&revision=1336093719&display=1 (opens in a new tab)x_refsource_CONFIRMx_transferred
- 49014 (opens in a new tab)third-party-advisoryx_refsource_SECUNIAx_transferred
- SUSE-SU-2012:0598 (opens in a new tab)vendor-advisoryx_refsource_SUSEx_transferred
- https://bugs.php.net/bug.php?id=61910 (opens in a new tab)x_refsource_CONFIRMx_transferred
- http://www.php.net/archive/2012.php#id2012-05-08-1 (opens in a new tab)x_refsource_CONFIRMx_transferred
- APPLE-SA-2012-09-19-2 (opens in a new tab)vendor-advisoryx_refsource_APPLEx_transferred
- http://support.apple.com/kb/HT5501 (opens in a new tab)x_refsource_CONFIRMx_transferred
- SSRT100992 (opens in a new tab)vendor-advisoryx_refsource_HPx_transferred
- http://eindbazen.net/2012/05/php-cgi-advisory-cve-2012-1823/ (opens in a new tab)x_refsource_MISCx_transferred
- VU#520827 (opens in a new tab)third-party-advisoryx_refsource_CERT-VNx_transferred
- DSA-2465 (opens in a new tab)vendor-advisoryx_refsource_DEBIANx_transferred
- 49085 (opens in a new tab)third-party-advisoryx_refsource_SECUNIAx_transferred
- http://www.php.net/ChangeLog-5.php#5.4.3 (opens in a new tab)x_refsource_CONFIRMx_transferred
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2012-2304 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisories (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2012-2311)Record last updated .