CVE-2012-2311

CVE-2012-2311 is a high-severity vulnerability in Php with a CVSS 2.0 base score of 7.5. Its EPSS exploit-prediction score of 69% places it in the 99th percentile, indicating an elevated likelihood of exploitation. The underlying weakness is classified as CWE-89.

Key facts

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.

Frequently asked questions

What is 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 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.
How severe is CVE-2012-2311?
CVE-2012-2311 has a CVSS 2.0 base score of 7.5, rated high severity.
Is CVE-2012-2311 being actively exploited?
It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 69% (99th percentile), an estimate of the probability of exploitation in the next 30 days.
What products are affected by CVE-2012-2311?
CVE-2012-2311 primarily affects Php. In total, 118 product configurations (CPEs) are listed as vulnerable; see the affected-products list for the exact versions.
How do I fix CVE-2012-2311?
Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Given its high severity, prioritise patching exposed systems.
When was CVE-2012-2311 published?
CVE-2012-2311 was published on 2012-05-11 and last updated on 2026-06-16.

References

Affected products (118)

More vulnerabilities in Php

All CVEs affecting Php →

Other CWE-89 (SQL Injection) vulnerabilities

Browse all CWE-89 (SQL Injection) vulnerabilities →

Threat intelligence

Threat-intel indicators referencing this CVE: