{"id":"CVE-2012-1823","published":"2012-05-11T10:15:48Z","modified":"2026-06-16T23:40:22Z","title":"PHP-CGI Query String Parameter Vulnerability","vendor":"PHP","product":"PHP","tier":"core","eol":null,"description":{"text":"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.","provenance":"source","from":"NVD"},"summary":{"text":"The PHP-CGI binary (sapi/cgi/cgi_main.c, php-cgi) in PHP before 5.3.12 and 5.4.x before 5.4.2 mishandles query strings that contain no equals sign, so command-line options can be injected through them. A remote attacker with no authentication and no user interaction, reaching a PHP installation configured to run as a CGI script, can send a crafted request to execute arbitrary code.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-10-29T13:44:48Z"},"cvss":{"score":9.8,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"NVD"},"epss":{"score":0.99998,"percentile":0.9999,"date":"2026-10-29","provenance":"source"},"kev":{"dateAdded":"2022-03-25","dueDate":"2022-04-15","ransomware":false,"requiredAction":"Apply updates per vendor instructions.","notes":"https://nvd.nist.gov/vuln/detail/CVE-2012-1823","provenance":"source"},"vulncheckKev":{"dateAdded":"2012-06-19","exploitedFirstSeen":"2012-06-19","ransomware":false,"evidence":[{"url":"https://www.fortiguard.com/encyclopedia/ips/31752","date":"2012-06-19"},{"url":"https://www.bleepingcomputer.com/news/security/linux-and-windows-servers-targeted-with-rubyminer-malware/","date":"2018-01-15"},{"url":"https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json","date":"2022-03-25"},{"url":"https://www.trustwave.com/hubfs/Web/Library/Documents_pdf/2024_Trustwave_Public_Sector_Threat_Landscape.pdf","date":"2024-05-14"},{"url":"https://censys.com/cve-2024-4577/","date":"2024-06-10"},{"url":"https://www.trustwave.com/hubfs/Web/Library/Documents_pdf/2024_Trustwave_Professional_Services_Sector_Threat_Landscape.pdf","date":"2024-06-26"},{"url":"https://www.akamai.com/blog/security-research/2024-php-exploit-cve-one-day-after-disclosure","date":"2024-07-10"},{"url":"https://www.f5.com/labs/articles/threat-intelligence/sensor-intel-series-top-cves-august-2024","date":"2024-09-19"},{"url":"https://www.f5.com/labs/articles/threat-intelligence/botpoke-scanner-switches-ip","date":"2024-11-25"},{"url":"https://www.f5.com/labs/articles/threat-intelligence/continued-scanning-for-cve-2023-1389","date":"2025-01-21"}],"evidenceTotal":16,"provenance":"source"},"exploited":true,"otx":{"pulseCount":50,"pulses":[{"name":"Actively_Exploited_Kev | Oct 29, 2026","url":"https://otx.alienvault.com/pulse/6ae20c1db17e7057ae7d9ad1","created":"2026-10-28"},{"name":"Actively_Exploited_Kev | Oct 28, 2026","url":"https://otx.alienvault.com/pulse/6ae0ba7e0e2a97ff7b218819","created":"2026-10-27"},{"name":"Actively_Exploited_Kev | Oct 27, 2026","url":"https://otx.alienvault.com/pulse/6adf68b85c3e852f3c111d18","created":"2026-10-26"},{"name":"Actively_Exploited_Kev | Oct 24, 2026","url":"https://otx.alienvault.com/pulse/6adb740e397c3ad4799aa4cd","created":"2026-10-23"},{"name":"Actively_Exploited_Kev | Oct 23, 2026","url":"https://otx.alienvault.com/pulse/6ada236fcfba2dfa730ea482","created":"2026-10-22"},{"name":"Critical PHP Remote Code Execution Flaws Draw Early Attacks Across Millions of Exposed Web Hosts","url":"https://otx.alienvault.com/pulse/6ad9246cb03e78ec5b4c0392","created":"2026-10-21"},{"name":"Actively_Exploited_Kev | Oct 22, 2026","url":"https://otx.alienvault.com/pulse/6ad8d33a077cbb5cab524d80","created":"2026-10-21"},{"name":"Actively_Exploited_Kev | Oct 21, 2026","url":"https://otx.alienvault.com/pulse/6ad78130c4d1ac2be83a8b6d","created":"2026-10-20"},{"name":"Actively_Exploited_Kev | Oct 20, 2026","url":"https://otx.alienvault.com/pulse/6ad62f63c24a405a3423cc13","created":"2026-10-19"},{"name":"Actively_Exploited_Kev | Oct 19, 2026","url":"https://otx.alienvault.com/pulse/6ad4dda174e5797d0bd238b7","created":"2026-10-18"}],"provenance":"machine"},"cwes":[{"id":"CWE-77","name":"Improper Neutralization of Special Elements used in a Command"},{"id":"CWE-20","name":"Improper Input Validation"}],"references":[{"url":"http://eindbazen.net/2012/05/php-cgi-advisory-cve-2012-1823/","tags":["Broken Link","Exploit"]},{"url":"http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c03360041","tags":["Broken Link"]},{"url":"http://lists.apple.com/archives/security-announce/2012/Sep/msg00004.html","tags":["Mailing List","Third Party Advisory"]},{"url":"http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00002.html","tags":["Mailing List","Third Party Advisory"]},{"url":"http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00007.html","tags":["Mailing List","Third Party Advisory"]},{"url":"http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00011.html","tags":["Mailing List","Third Party Advisory"]},{"url":"http://marc.info/?l=bugtraq&m=134012830914727&w=2","tags":["Mailing List"]},{"url":"http://rhn.redhat.com/errata/RHSA-2012-0546.html","tags":["Third Party Advisory"]},{"url":"http://rhn.redhat.com/errata/RHSA-2012-0547.html","tags":["Third Party Advisory"]},{"url":"http://rhn.redhat.com/errata/RHSA-2012-0568.html","tags":["Third Party Advisory"]},{"url":"http://rhn.redhat.com/errata/RHSA-2012-0569.html","tags":["Third Party Advisory"]},{"url":"http://rhn.redhat.com/errata/RHSA-2012-0570.html","tags":["Third Party Advisory"]},{"url":"http://secunia.com/advisories/49014","tags":["Broken Link"]},{"url":"http://secunia.com/advisories/49065","tags":["Broken Link"]},{"url":"http://secunia.com/advisories/49085","tags":["Broken Link"]},{"url":"http://secunia.com/advisories/49087","tags":["Broken Link"]},{"url":"http://support.apple.com/kb/HT5501","tags":["Third Party Advisory"]},{"url":"http://www.debian.org/security/2012/dsa-2465","tags":["Third Party Advisory"]},{"url":"http://www.kb.cert.org/vuls/id/520827","tags":["Exploit","Third Party Advisory","US Government Resource"]},{"url":"http://www.kb.cert.org/vuls/id/673343","tags":["Third Party Advisory","US Government Resource"]},{"url":"http://www.mandriva.com/security/advisories?name=MDVSA-2012:068","tags":["Broken Link"]},{"url":"http://www.openwall.com/lists/oss-security/2024/06/07/1","tags":["Mailing List"]},{"url":"http://www.php.net/ChangeLog-5.php#5.4.2","tags":["Exploit","Patch","Release Notes"]},{"url":"http://www.php.net/archive/2012.php#id2012-05-03-1","tags":["Release Notes"]},{"url":"http://www.securitytracker.com/id?1027022","tags":["Broken Link","Third Party Advisory","VDB Entry"]},{"url":"https://bugs.php.net/bug.php?id=61910","tags":["Exploit","Patch"]},{"url":"https://bugs.php.net/patch-display.php?bug_id=61910&patch=cgi.diff&revision=1335984315&display=1","tags":["Patch"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B/","tags":["Mailing List","Release Notes"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/W45DBOH56NQDRTOM2DN2LNA2FZIMC3PK/","tags":["Mailing List","Release Notes"]},{"url":"http://eindbazen.net/2012/05/php-cgi-advisory-cve-2012-1823/","tags":["Broken Link","Exploit"]},{"url":"http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c03360041","tags":["Broken Link"]},{"url":"http://lists.apple.com/archives/security-announce/2012/Sep/msg00004.html","tags":["Mailing List","Third Party Advisory"]},{"url":"http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00002.html","tags":["Mailing List","Third Party Advisory"]},{"url":"http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00007.html","tags":["Mailing List","Third Party Advisory"]},{"url":"http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00011.html","tags":["Mailing List","Third Party Advisory"]},{"url":"http://marc.info/?l=bugtraq&m=134012830914727&w=2","tags":["Mailing List"]},{"url":"http://rhn.redhat.com/errata/RHSA-2012-0546.html","tags":["Third Party Advisory"]},{"url":"http://rhn.redhat.com/errata/RHSA-2012-0547.html","tags":["Third Party Advisory"]},{"url":"http://rhn.redhat.com/errata/RHSA-2012-0568.html","tags":["Third Party Advisory"]},{"url":"http://rhn.redhat.com/errata/RHSA-2012-0569.html","tags":["Third Party Advisory"]},{"url":"http://rhn.redhat.com/errata/RHSA-2012-0570.html","tags":["Third Party Advisory"]},{"url":"http://secunia.com/advisories/49014","tags":["Broken Link"]},{"url":"http://secunia.com/advisories/49065","tags":["Broken Link"]},{"url":"http://secunia.com/advisories/49085","tags":["Broken Link"]},{"url":"http://secunia.com/advisories/49087","tags":["Broken Link"]},{"url":"http://support.apple.com/kb/HT5501","tags":["Third Party Advisory"]},{"url":"http://www.debian.org/security/2012/dsa-2465","tags":["Third Party Advisory"]},{"url":"http://www.kb.cert.org/vuls/id/520827","tags":["Exploit","Third Party Advisory","US Government Resource"]},{"url":"http://www.kb.cert.org/vuls/id/673343","tags":["Third Party Advisory","US Government Resource"]},{"url":"http://www.mandriva.com/security/advisories?name=MDVSA-2012:068","tags":["Broken Link"]},{"url":"http://www.openwall.com/lists/oss-security/2024/06/07/1","tags":["Mailing List"]},{"url":"http://www.php.net/ChangeLog-5.php#5.4.2","tags":["Exploit","Patch","Release Notes"]},{"url":"http://www.php.net/archive/2012.php#id2012-05-03-1","tags":["Release Notes"]},{"url":"http://www.securitytracker.com/id?1027022","tags":["Broken Link","Third Party Advisory","VDB Entry"]},{"url":"https://bugs.php.net/bug.php?id=61910","tags":["Exploit","Patch"]},{"url":"https://bugs.php.net/patch-display.php?bug_id=61910&patch=cgi.diff&revision=1335984315&display=1","tags":["Patch"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B/","tags":["Mailing List","Release Notes"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/W45DBOH56NQDRTOM2DN2LNA2FZIMC3PK/","tags":["Mailing List","Release Notes"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B/","tags":["Mailing List","Release Notes"]},{"url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2012-1823","tags":["US Government Resource"]}],"techniques":[{"id":"T1190","name":"Exploit Public-Facing Application","tactics":["initial-access"],"provenance":"ai","basis":"ai-mapping","bases":["ai-mapping"],"basisDetail":"claude-haiku-5-5: Remote unauthenticated exploitation of public-facing PHP CGI","mappingType":"exploitation_technique","evidence":[{"from":"description","quote":"php-cgi), does not properly handle query strings","start":102,"end":150}],"model":"claude-haiku-5-5","confidence":"medium","confidenceNote":"AI-mapped from the description (quote-validated, not expert-reviewed)"},{"id":"T1059","name":"Command and Scripting Interpreter","tactics":["execution"],"provenance":"ai","basis":"ai-mapping","bases":["ai-mapping"],"basisDetail":"claude-haiku-5-5: Arbitrary code execution via injected command-line options","mappingType":"primary_impact","evidence":[{"from":"description","quote":"allows remote attackers to execute arbitrary code","start":197,"end":246}],"model":"claude-haiku-5-5","confidence":"medium","confidenceNote":"AI-mapped from the description (quote-validated, not expert-reviewed)"}],"reports":[],"affected":[],"advisories":[],"euvd":{"id":"EUVD-2012-1833","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2012-1833","exploited":true,"exploitedSince":"2022-03-25","provenance":"source"},"exploits":[{"id":18834,"url":"https://www.exploit-db.com/exploits/18834","title":"PHP 5.3.12/5.4.2 - CGI Argument Injection (Metasploit)","type":"remote","platform":"php","date":"2012-05-04","verified":true,"provenance":"source"},{"id":18836,"url":"https://www.exploit-db.com/exploits/18836","title":"PHP < 5.3.12 / < 5.4.2 - CGI Argument Injection","type":"remote","platform":"php","date":"2012-05-05","verified":true,"provenance":"source"},{"id":29290,"url":"https://www.exploit-db.com/exploits/29290","title":"Apache + PHP < 5.3.12 / < 5.4.2 - cgi-bin Remote Code Execution","type":"remote","platform":"php","date":"2013-10-29","verified":true,"provenance":"source"},{"id":29316,"url":"https://www.exploit-db.com/exploits/29316","title":"Apache + PHP < 5.3.12 / < 5.4.2 - Remote Code Execution + Scanner","type":"remote","platform":"php","date":"2013-10-31","verified":false,"provenance":"source"}],"exploitSources":{"exploitdb":{"count":4,"earliest":"2012-05-04"},"pocGithub":{"count":14,"skipped":2,"earliest":"2015-09-08","earliestUrl":"https://github.com/drone789/CVE-2012-1823","repos":[{"name":"0xl0k1/CVE-2012-1823","url":"https://github.com/0xl0k1/CVE-2012-1823","stars":12,"created":"2023-08-24"},{"name":"Unix13/metasploitable2","url":"https://github.com/Unix13/metasploitable2","stars":4,"created":"2019-07-05"},{"name":"tardummy01/oscp_scripts-1","url":"https://github.com/tardummy01/oscp_scripts-1","stars":3,"created":"2017-10-01"},{"name":"mujtaba815/metasploitable2-php-cgi-exploit","url":"https://github.com/mujtaba815/metasploitable2-php-cgi-exploit","stars":3,"created":"2026-10-02"},{"name":"drone789/CVE-2012-1823","url":"https://github.com/drone789/CVE-2012-1823","stars":1,"created":"2015-09-08"}]},"metasploit":[{"name":"PHP CGI Argument Injection","module":"exploit/multi/http/php_cgi_arg_injection","type":"exploit","disclosureDate":"2012-05-03","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/php_cgi_arg_injection.rb"}],"nuclei":[{"id":"CVE-2012-1823","name":"PHP CGI v5.3.12/5.4.2 Remote Code Execution","severity":"high","path":"http/cves/2012/CVE-2012-1823.yaml","url":"https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2012/CVE-2012-1823.yaml"}],"first":{"date":"2012-05-03","source":"Metasploit","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/php_cgi_arg_injection.rb"},"provenance":"source"},"exploitRefs":["http://eindbazen.net/2012/05/php-cgi-advisory-cve-2012-1823/","http://www.kb.cert.org/vuls/id/520827","http://www.php.net/ChangeLog-5.php#5.4.2","https://bugs.php.net/bug.php?id=61910"],"flow":[{"stage":"exploitation","techniques":["T1190"],"provenance":"ai"},{"stage":"primary","techniques":["T1059"],"provenance":"ai"}],"timeline":[{"date":"2012-05-03","kind":"exploit-public","label":"First public exploit: Metasploit; later: Exploit-DB 2012-05-04, PoC-in-GitHub 2015-09-08","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/php_cgi_arg_injection.rb","provenance":"source"},{"date":"2012-05-11","kind":"published","label":"Published (NVD)","url":"https://nvd.nist.gov/vuln/detail/CVE-2012-1823","provenance":"source"},{"date":"2012-06-19","kind":"exploited-reported","label":"Exploitation first reported (VulnCheck KEV evidence)","url":"https://www.fortiguard.com/encyclopedia/ips/31752","provenance":"source"},{"date":"2022-03-25","kind":"kev","label":"Added to CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","provenance":"source"},{"date":"2022-03-25","kind":"euvd-exploited","label":"ENISA EUVD: exploited","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2012-1833","provenance":"source"}],"speed":{"daysToPublicExploit":null,"firstExploitFrom":"Metasploit","daysToKev":3605},"priority":{"score":69.9,"factors":[{"name":"In a KEV catalog","points":35.0,"detail":"listed in CISA KEV and VulnCheck KEV"},{"name":"Recent KEV listing","points":0.0,"detail":"added 5245 days ago"},{"name":"Known ransomware use","points":0.0,"detail":"not known"},{"name":"EPSS percentile","points":20.0,"detail":"percentile 0.9999"},{"name":"Named in threat reports","points":0.0,"detail":"0 reports"},{"name":"Public exploit code","points":5.0,"detail":"4 NVD references tagged Exploit; 4 Exploit-DB entries; 14 PoC-in-GitHub repos; 1 Metasploit module; 1 nuclei template"},{"name":"Mentioned in OTX pulses","points":3.0,"detail":"50 pulses"},{"name":"CVSS severity","points":6.86,"detail":"base score 9.8"},{"name":"End-of-life product","points":0.0,"detail":"supported or unknown"}]},"lineage":{"familyId":"fam-php-cve-2012-1823","children":[{"from":"CVE-2012-1823","to":"CVE-2012-2311","relation":"incomplete-fix","confidence":"high","kind":"lineage","orderedBy":"description","evidence":[{"kind":"text","provenance":"source","relation":"incomplete-fix","quote":"NOTE: this vulnerability exists because of an incomplete fix for CVE-2012-1823.","from":"CVE.org","in":"CVE-2012-2311"}]},{"from":"CVE-2012-1823","to":"CVE-2012-2336","relation":"incomplete-fix","confidence":"high","kind":"lineage","orderedBy":"description","evidence":[{"kind":"text","provenance":"source","relation":"incomplete-fix","quote":"NOTE: this vulnerability exists because of an incomplete fix for CVE-2012-1823.","from":"CVE.org","in":"CVE-2012-2336"}]}]}}