CVE-2012-1823
Description
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.
Severity
CRITICAL
CVSS v3
9.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H · source adp
Exploit chance (EPSS)
99.998%
chance of exploitation in the next 30 days
among the highest of scored CVEs · 2026-11-17
CISA KEV
Listed
added 2022-03-25
Public exploit code
Yes
Exploit references (NVD and CNA): 4
Metasploit modules: 1
Nuclei templates: 1
Exploit-DB: 4
Weakness
- CWE-77: Improper Neutralization of Special Elements used in a Command
CISA Known Exploited Vulnerabilities entry
| Vulnerability name | PHP-CGI Query String Parameter Vulnerability |
|---|---|
| Vendor / product | PHP / PHP |
| Date added | 2022-03-25 |
| Federal remediation due date | 2022-04-15 |
| Required action | Apply updates per vendor instructions. |
| Known ransomware campaign use | Unknown |
CISA SSVC decision points
| Exploitation | active |
|---|---|
| Automatable | yes |
| Technical impact | total |
| Scored | 2025-02-07 |
Timeline
- 2012-05-04First Exploit-DB entry (EDB-ID 18834)7 days before publication
- 2012-05-11Published by the CNA10:00 UTC
- 2022-03-25Added to the CISA KEV catalog3605 days after publication
- 2025-02-07CISA SSVC decision recorded4655 days after publication
Exploit and advisory records
| Exploit-DB | Type | Platform | Published | EDB-verified |
|---|---|---|---|---|
| EDB-ID 29290 | remote | php | 2013-10-29 | yes |
| EDB-ID 18836 | remote | php | 2012-05-05 | yes |
| EDB-ID 18834 | remote | php | 2012-05-04 | yes |
| EDB-ID 29316 | remote | php | 2013-10-31 | no |
Nuclei templates:
- CVE-2012-1823: PHP CGI v5.3.12/5.4.2 Remote Code Execution
Affected products
| Vendor | Product |
|---|---|
| apple | mac_os_x |
| debian | debian_linux |
| fedoraproject | fedora |
| hp | hp-ux |
| opensuse | opensuse |
| php | php |
| redhat | application_stack |
| redhat | enterprise_linux_desktop |
| redhat | enterprise_linux_eus |
| redhat | enterprise_linux_server |
| redhat | enterprise_linux_server_aus |
| redhat | enterprise_linux_workstation |
| redhat | gluster_storage_server_for_on-premise |
| redhat | storage |
| redhat | storage_for_public_cloud |
| suse | linux_enterprise_server |
| suse | linux_enterprise_software_development_kit |
References
- http://www.php.net/ChangeLog-5.php#5.4.2
- https://bugs.php.net/bug.php?id=61910
- https://bugs.php.net/patch-display.php?bug_id=61910&patch=cgi.diff&revision=1335984315&display=1
- http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c03360041
- http://lists.apple.com/archives/security-announce/2012/Sep/msg00004.html
- http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00002.html
- http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00007.html
- http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00011.html
- http://marc.info/?l=bugtraq&m=134012830914727&w=2
- http://rhn.redhat.com/errata/RHSA-2012-0546.html
- http://rhn.redhat.com/errata/RHSA-2012-0547.html
- http://rhn.redhat.com/errata/RHSA-2012-0568.html
- http://rhn.redhat.com/errata/RHSA-2012-0569.html
- http://rhn.redhat.com/errata/RHSA-2012-0570.html
- http://www.debian.org/security/2012/dsa-2465
- http://www.mandriva.com/security/advisories?name=MDVSA-2012:068
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/W45DBOH56NQDRTOM2DN2LNA2FZIMC3PK/
- http://eindbazen.net/2012/05/php-cgi-advisory-cve-2012-1823/
- http://www.kb.cert.org/vuls/id/520827
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cve_lookup/CVE-2012-1823'curl 'https://api.contrastcyber.com/cve_risk_score/CVE-2012-1823'curl 'https://api.contrastcyber.com/cve_exploit/CVE-2012-1823'curl 'https://api.contrastcyber.com/cve_products/CVE-2012-1823'curl 'https://api.contrastcyber.com/kev_lookup/CVE-2012-1823'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- OWASP Top 10 categories by the OWASP Foundation (CC BY 3.0).
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).