CVE-2012-1823: PHP-CGI Query String Parameter Vulnerability
CVE-2012-1823 is a critical-severity flaw (CVSS 9.8) affecting php, fedora, debian linux, reported as exploited in the wild. Below: why it ranks where it does, which versions are affected, what to do, and the exact commands.
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.
Why this priority
- Critical severity
- EPSS top 1%: very likely to be exploited
- Exploited in the wild (CISA KEV)
- Public exploit reference
- CISA SSVC: automatable with total technical impact
- Remotely exploitable, no login, no user action
- On your watchlist
A fixed release or distro patch exists.
Risk facts
| CVSS score | 9.8 (Critical) |
| Attack vector | Network (remote) |
| Attack complexity | Low |
| Privileges needed | None |
| User interaction | None |
| EPSS exploit chance | 100.0% (top 1%) |
| CISA exploited list | Yes, fix due 2022-04-15 |
| Weakness | CWE-77 |
| Published | 2012-05-11 |
| Last modified | 2026-06-16 |
Last updated 2026-06-16 · Sources: CVE Program, NVD, CISA KEV, EPSS and vendor advisories · How we score
Am I affected?
Timeline
- Published CVE record published
- Exploited Added to the CISA Known Exploited Vulnerabilities list
- Deadline CISA due date for US federal agencies to patch
- Updated Record last modified
Exact fixes by distribution
Public exploits and detection
Public code exists for this CVE. Treat unpatched systems as at risk, and only run PoCs in a lab.
- GitHub PoC: 0xl0k1/CVE-2012-1823 (12 stars)
- GitHub PoC: Unix13/metasploitable2 (4 stars)
- Exploit-DB: Apache + PHP < 5.3.12 / < 5.4.2 - cgi-bin Remote Code Execution
- Exploit-DB: Apache + PHP < 5.3.12 / < 5.4.2 - Remote Code Execution + Scanner
- Exploit-DB: PHP 5.3.12/5.4.2 - CGI Argument Injection (Metasploit)
- Exploit-DB: PHP < 5.3.12 / < 5.4.2 - CGI Argument Injection
- Metasploit: PHP CGI Argument Injection
- Nuclei scan template: PHP CGI v5.3.12/5.4.2 Remote Code Execution
Advisories and coverage
Research and news
- Tenable Research: php2shell (CVE-2026-109618, CVE-2026-109619): Frequently asked questions about critical PHP remote code execution vulnerabilities 2026-10-21
Scores and fixes here are computed automatically from those and other public sources. Confirm with the vendor advisory before changing production systems.
Quick answers
How do I fix CVE-2012-1823?
php: upgrade to 5.3.12, 5.4.2; fedora: mitigate or apply the listed mitigation; debian linux: mitigate or apply the listed mitigation. Exact commands for each OS are on this page.
Is CVE-2012-1823 being exploited?
Yes. CVE-2012-1823 is on the CISA Known Exploited Vulnerabilities list, so treat it as patch-now.
What does CVE-2012-1823 affect?
CVE-2012-1823 affects php, fedora, debian linux. Severity is critical (CVSS 9.8). 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 arbitrar
How urgent is CVE-2012-1823?
Priority 100/100. Critical severity; EPSS top 1%: very likely to be exploited; Exploited in the wild (CISA KEV); Public exploit reference; CISA SSVC: automatable with total technical impact; Remotely exploitable, no login, no user action; On your watchlist
Software pages
PHP vulnerabilities · Debian vulnerabilities
Related CVEs
- CVE-2026-109619 HIGH 8.1 EXPLOITED UPGRADE MITIGATE PHP Stale Internal Request-State Vulnerability
- CVE-2026-109618 CRITICAL 9.8 EXPLOITED UPGRADE MITIGATE PHP Memory Corruption Vulnerability
- CVE-2026-91768 MEDIUM 6.5 UPGRADE The IPv6 branch of the FastCGI client access check compares only the first 12 bytes of a 16-byte IPv6 address,
- CVE-2026-92842 MEDIUM 5.9 UPGRADE The convert.base64-encode, convert.quoted-printable-encode and convert.quoted-printable-decode stream filters
- CVE-2026-91767 MEDIUM 6.5 UPGRADE php_openssl_matches_wildcard_name() in ext/openssl/xp_ssl.c underflows the length argument passed to memchr()