CVE-2012-1823 PHP-CGI Query String Parameter Vulnerability
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.
From the CISA KEV catalogue version 2026.11.06, with Cybergen analysis. Updated 6 Nov 2026.
Should You Worry?
- CISA confirmed exploitation in the wild and added it to the Known Exploited Vulnerabilities catalogue on 25 Mar 2022.
- Rated Critical severity (CVSS 9.8, scored by CISA).
- It has been in the catalogue for 1,687 days. Systems still unpatched now have almost certainly been scanned for it.
What It Is
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.
What To Do Now
- 1
Find it
Search your asset inventory and external attack surface for PHP. Include cloud images, appliances and anything a supplier runs for you.
Attack Surface Management - 2
- 3
Hunt for compromise
If an affected system was reachable before you patched, assume it may have been hit. Check logs, new accounts, web shells and outbound connections from the date of exposure.
Incident Response - 4
Prove it is fixed
Rescan or test the system after patching. Upgrades that fail silently and forgotten secondary instances are common.
Penetration Testing
Vendor Advisories
The Compliance Clock
General guidance, not legal advice. Your obligations depend on your sector, scope and jurisdiction.
Not Sure If You Are Exposed?
Our attack surface and vulnerability teams can check your internet-facing estate for CVE-2012-1823 and every other exploited flaw on the list.
Sources
- CISA Known Exploited Vulnerabilities catalogue
- NVD: CVE-2012-1823
- CVE record: CVE-2012-1823
- FIRST EPSS
- marc.info/?l=bugtraq&m=134012830914727&w=2
- lists.opensuse.org/opensuse-security-announce/2012-05/msg00011.html
- securitytracker.com/id?1027022
- h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c03360041
- mandriva.com/security/advisories?name=MDVSA-2012:068
- lists.opensuse.org/opensuse-security-announce/2012-05/msg00002.html
- rhn.redhat.com/errata/RHSA-2012-0546.html
- rhn.redhat.com/errata/RHSA-2012-0568.html
