patchminder
Exploited in the wild · CISA KEV CVE-2012-1823

Remote code executionin PHP.

Published 11 May 2012 · Updated 4 Nov 2025 · Every fact sourced

JSONCite
Is it exploited?
Yes

On CISAThe US cyber defence agency. Its list names every hole it has seen used in real attacks.'s exploited list since 25 Mar 2022.

On CISA's listAttack code is public
Severity
Critical 9.8
CVSSA severity score from 0 to 10. 9 and higher is critical. 3.1 · CISAThe US cyber defence agency. Its list names every hole it has seen used in real attacks. assessment · no login needed
Attack likelihood
Very high
EPSSA daily score from FIRST: the chance a hole is attacked in the next 30 days. 100.0% chance in 30 days · 4 Dec 2026
Fix
Not confirmed
See the vendor advisory
In plain words

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.

CISA: sapi/cgi/cgi_main.c in PHP, when configured as a CGI script, does not properly handle query strings, which allows remote attackers to execute arbitrary code.

What to do now
  • CISA requires US federal agencies to fix it by 15 Apr 2022.

Not confirmed by any source yet: affected versions not confirmed; fixed version not confirmed. We show these as not confirmed instead of guessing.

Versions

Affected and fixed versions

Product or package
Affected
Fixed in
Source
n/a
Not confirmed
Not confirmed
CVE record

From the CVE record, NVD and package advisories. When no source has versions yet, this table says "not confirmed" instead of guessing.

Timeline

From first report to first attacks

  1. 21 Mar 2012
    CVE ID reserved by certcc.
  2. 3 May 2012
    Metasploit module: PHP CGI Argument Injection.
  3. 11 May 2012
    Published in the CVE List.
  4. 8 Sep 2015
    First public proof of concept on GitHub.
  5. 25 Mar 2022
    Added to CISA's Known Exploited Vulnerabilities list.
  6. 4 Nov 2025
    CVE record last updated.
Exploit code

Attack code anyone can find

Exploit maturity: Exploited in the wild (CISA KEV). CISA assessment (SSVC): exploitation active.

Metasploit module
1 module
Nuclei scan template
Available
Exploit-DB
4 entries
GitHub proof of concepts
17 repositories
MetasploitPHP CGI Argument Injectionrank excellentLinked once a fix or workaround is known.
NucleiPHP CGI v5.3.12/5.4.2 Remote Code Executiondetection templateLinked once a fix or workaround is known.
Exploit-DBEDB-ID 29290remote exploit for php, published 29 Oct 2013, verified by Exploit-DBLinked once a fix or workaround is known.
Exploit-DBEDB-ID 29316remote exploit for php, published 31 Oct 2013Linked once a fix or workaround is known.
Exploit-DBEDB-ID 18834remote exploit for php, published 4 May 2012, verified by Exploit-DBLinked once a fix or workaround is known.
Exploit-DBEDB-ID 18836remote exploit for php, published 5 May 2012, verified by Exploit-DBLinked once a fix or workaround is known.

10 proof of concept repositories on GitHub. No fix or workaround is known yet, so we count them but do not link to them.

Listed so defenders can judge how urgent this is and test systems they are authorised to test. Patchminder does not host exploit code; links open the source page. Labels for GitHub repositories come from their public details and are never a promise about the code. Run anything only in an isolated lab.

Related

Other PHP vulnerabilities

Same weakness: Command injection

All CWE-77 vulnerabilities

References
Cite this page

Patchminder. CVE-2012-1823: Remote code execution in PHP. https://patchminder.com/cve/cve-2012-1823/ (accessed 5 December 2026).