Vulnerability · CVE-2012-1823
PHP-CGI Query String Parameter Vulnerability
Published May 11, 2012 · catalog updated Jun 16, 2026 · PHP PHP
Patch now
CVE-2012-1823 is in the CISA known-exploited catalog, due Apr 15, 2022. Confirm PHP PHP against the vendor advisory and apply that fix. The CVSS score does not change the priority.
- Severity
- Critical9.8
- Known exploitation
- CISA KEV and VulnCheck KEV
- EPSS
- 100.00%
- Remediation
- Remediation guidance
- Affected products
- cpe apple/mac os x · cpe debian/debian linux · cpe fedoraproject/fedora · cpe hp/hp-ux · cpe opensuse/opensuse · cpe php/php
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.
Are you affected?
Enter the version you run. The result uses only the ranges stored on this record.
The check returns affected, not affected, or incomplete. It does not guess a version that is missing from the record.
- cpe apple/mac os xversion unspecified
- cpe debian/debian linux6.0
- cpe fedoraproject/fedora39
- cpe fedoraproject/fedora40
- cpe hp/hp-uxb.11.23
- cpe hp/hp-uxb.11.31
- cpe opensuse/opensuse11.4
- cpe php/phpversion unspecified
- cpe redhat/application stack2.0
- vendor PHP PHPversion unspecified
- vendor n/a n/aversion unspecified
How to fix CVE-2012-1823
Recommended remediation
Apply updates per vendor instructions. CISA due date Apr 15, 2022.
Official advisories
What to do
Three questions, each answered from this record only. Confirm the vendor advisory before you patch.
Should you patch?
CVE-2012-1823 is in the CISA known-exploited catalog, due Apr 15, 2022. Confirm PHP PHP against the vendor advisory and apply that fix. The CVSS score does not change the priority.
Which versions are affected?
Compare what you have installed with debian/debian linux 6.0; redhat/application stack 2.0. Apply updates per vendor instructions.
What should an analyst verify?
CWE-20: Improper Input Validation; CWE-77: Command Injection. EPSS 100.00%. The CISA KEV listing is the exploitation evidence. A public exploit reference is linked in Sources. That is not the same as confirmed exploitation. Use the source links for the original advisory.
Code
The project this record applies to. Exploit listings stay in References.
No public source repository is identified for this product.
Timeline
Detection, updates, and resolution for this record.
May 11, 2012 · Catalog
Detected
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.
Mar 25, 2022 · CISA KEV
Known exploited
Apply updates per vendor instructions.
Apr 15, 2022 · CISA KEV
Remediation due
Apply updates per vendor instructions.
Jun 16, 2026 · Catalog
Updated
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.
Sources
- CISA KEVConfirmed exploitationCVE-2012-1823
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.
cisa.gov - CVE.orgVulnerability recordCVE-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 i
cve.org - FIRST EPSSExploitation probabilityCVE-2012-1823
30-day exploitation probability 100.0%
first.org - Exploit DatabasePublic exploit reference18834
Public archive entry. The exploit body is not stored here.
exploit-db.com - Exploit DatabasePublic exploit reference29290
Public archive entry. The exploit body is not stored here.
exploit-db.com - Exploit DatabasePublic exploit reference29316
Public archive entry. The exploit body is not stored here.
exploit-db.com - Metasploit ModulesPublic exploit moduleexploit_multi/http/php_cgi_arg_injection
Public module reference (excellent). Module source is not copied into this catalog.
rapid7.com - NIST NVDVulnerability recordCVE-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 i
nvd.nist.gov - VulnCheck KEVConfirmed exploitationCVE-2012-1823
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.
vulncheck.com
References
- Broken Link · eindbazen.net
- Broken Link · h20000.www2.hp.com
- Mailing List · lists.apple.com
- Mailing List · lists.opensuse.org
- Mailing List · lists.opensuse.org
- Mailing List · lists.opensuse.org
- Mailing List · marc.info
- Third Party Advisory · rhn.redhat.com
- RHSA-2012:0568 · rhn.redhat.com
- MDVSA-2012:068 · mandriva.com
- 1027022 · securitytracker.com
- VulnCheck exploitation evidence · censys.com
- CISA note · nvd.nist.gov
- VulnCheck exploitation evidence · bleepingcomputer.com
- VulnCheck exploitation evidence · cisa.gov
- VulnCheck exploitation evidence · fortiguard.com
- VulnCheck exploitation evidence · trustwave.com
- VulnCheck exploitation evidence · trustwave.com
Freshness
Last verified in this catalog Oct 17, 2026. Significant claims (KEV, EPSS, CVSS, affected ranges) come from the source rows above — open the original publisher for the authoritative advisory.