Am I affected?
CVE-2012-1823
sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not properly handle query strings that lack an = (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.
Exploit probability (FIRST EPSS): >99.9% chance of exploitation activity in the next 30 days (top 1% of all scored CVEs), scored 2026-11-23. EPSS is a likelihood estimate, not proof of attacks.
Check your PHP version
Fixed versions by branch
| Branch | Affected (NVD) | Fixed in |
|---|---|---|
| PHP 5.4 | 5.4.0 (including) to 5.4.2 (excluding) | 5.4.2 |
| PHP 5.3 | PHP 5.3 only, before 5.3.12 | 5.3.12 |
"Fixed in" is shown only when the source gives an exact upper bound. Any later patch in the same branch also has the fix. Linux distributions (Ubuntu, Debian, RHEL) often backport fixes without changing the PHP version number.
Related CVEs
Other PHP CVEs that NVD lists for the same branches.
- CVE-2012-2688 High 10.0 · PHP 5.4, 5.3 · 2012-07-20
- CVE-2012-2376 High 10.0 · PHP 5.4, 5.3 · 2012-05-21
- CVE-2012-2386 High 7.5 · PHP 5.4, 5.3 · 2012-07-07
- CVE-2012-2311 High 7.5 · PHP 5.4, 5.3 · 2012-05-11
- CVE-2012-2335 High 7.5 · PHP 5.4, 5.3 · 2012-05-11
- CVE-2012-2336 Medium 5.0 · PHP 5.4, 5.3 · 2012-05-11
Questions
- Which PHP versions are affected by CVE-2012-1823?
- NVD lists these affected ranges: 5.4.0 (including) to 5.4.2 (excluding); PHP 5.3 only, before 5.3.12.
- Which PHP version fixes CVE-2012-1823?
- According to NVD, the fix is in PHP 5.4.2, 5.3.12 (upgrade to that release or any later patch in the same branch).
- Does a version check prove my server is safe from CVE-2012-1823?
- No. The SAPI, web server, operating system, loaded extensions and configuration change whether a bug can be reached, and Linux distributions often backport fixes without changing the upstream version number.
Sources: CVE-2012-1823 on NIST NVD. NVD data synced 2026-11-24T03:47:46.548Z. See all PHP CVEs in the CVE explorer.