CVE-2012-2311
HighExploitedPublic exploitphp: incomplete CVE-2012-1823 fix - incorrect check for =
Published May 3, 2012 · Updated Mar 9, 2026
Key Facts
Patch immediately- CVE-2012-2311 is a high-severity vulnerability (CVSS 7.5 v2) affecting PHP, php5 (debian), apache2-mod_php5 (suse) and 22 more products.
- It is exploited in the wild, listed in Industry KEV feed since May 9, 2012. Public exploit code is available.
- EPSS estimates a 69% probability of exploitation in the next 30 days.
- Fixed versions are available, including apache2-mod_php5 5.6.28-1.1, apache2-mod_php7 7.0.14-1.4, PHP 5.3.12.
- Brandefense priority: patch immediately, because it is listed as exploited in the wild.
CVSS v2
7.5
AV:N/AC:L/Au:N/C:P/I:P/A:P
EPSS (30-day exploit likelihood)
69%
Higher than 99.3% of all scored CVEs
Exploited in the wild
Yes
1 catalog listing
Public exploit code
Available
Proof-of-concept or weaponized module
Get the full CVE-2012-2311 brief as a PDF
Every affected product and fixed release, exploitation status and a first 24 hours response checklist, emailed within minutes.
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.
Known-Exploited Catalog Listings
| Catalog | Added | Remediation due | Ransomware use |
|---|---|---|---|
| Industry KEV feed | May 9, 2012 | n/a | Not reported |
Required action: Apply remediations or mitigations per vendor instructions or discontinue use of the product if remediation or mitigations are unavailable.
Affected Products
235 affected entries in total| Product | Affected versions | Fixed in |
|---|---|---|
| PHPPHP | 1.0, 2.0, 2.0b10, 3.0, 3.0.1, 3.0.10, 3.0.11, 3.0.12 | 5.3.12 |
| php5debian | See advisory | 5.3.3-7+squeeze9 |
| apache2-mod_php5suse | See advisory | 5.6.28-1.1 |
| apache2-mod_php7suse | See advisory | 7.0.14-1.4 |
| php5-bcmathsuse | See advisory | 5.6.28-1.1 |
Patched Releases
apache2-mod_php5
5.6.28-1.1
apache2-mod_php7
7.0.14-1.4
PHP
5.3.12
php5
5.3.3-7+squeeze9, 5.6.28-1.1
php5-bcmath
5.6.28-1.1
php5-bz2
5.6.28-1.1
php5-calendar
5.6.28-1.1
php5-ctype
5.6.28-1.1
php5-curl
5.6.28-1.1
php5-dba
5.6.28-1.1
php5-devel
5.6.28-1.1
php5-dom
5.6.28-1.1
php5-enchant
5.6.28-1.1
php5-exif
5.6.28-1.1
php5-fastcgi
5.6.28-1.1
php5-fileinfo
5.6.28-1.1
php5-firebird
5.6.28-1.1
php5-fpm
5.6.28-1.1
php5-ftp
5.6.28-1.1
php5-gd
5.6.28-1.1
php5-gettext
5.6.28-1.1
php5-gmp
5.6.28-1.1
php5-iconv
5.6.28-1.1
php5-imap
5.6.28-1.1
php5-intl
5.6.28-1.1
Timeline
Publicly disclosed
May 3, 2012
Added to Industry KEV feed
May 9, 2012
Last updated
Mar 9, 2026
Weakness Type
- CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
References
- advisoryhttps://bugs.php.net/bug.php?id=61910
- exploitVulnCheck exploitation report
- exploitVulnCheck exploitation report
- exploitExploitDB-18834
- exploitExploitDB-18836
FAQ
Common Questions.
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 strin…
Affected: PHP versions 1.0, 2.0, 2.0b10, 3.0, 3.0.1, 3.0.10, 3.0.11, 3.0.12; php5 (debian); apache2-mod_php5 (suse), among others. The full list is in the CVE brief.
It is exploited in the wild, listed in Industry KEV feed since May 9, 2012.
No, it is not currently listed in the CISA Known Exploited Vulnerabilities catalog.
Public exploit code is available.
Fixed versions are available, including apache2-mod_php5 5.6.28-1.1, apache2-mod_php7 7.0.14-1.4, PHP 5.3.12.
Brandefense priority: patch immediately, because it is listed as exploited in the wild.
Is CVE-2012-2311 Running On Your Attack Surface?
Brandefense maps vulnerabilities like this one to your internet-facing assets and tells you exactly where to patch.
Request A Demo