What’s Vulnerable › Vulnerabilities
CVE-2012-1823: PHP-CGI Query String Parameter Vulnerability
- Severity: high (CVSS 7.5 v2.0)
- Exploited in the wild: yes — in CISA KEV since 2022-03-25
- EPSS: 100.0% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2012-05-11 · updated 2026-06-16
- Weakness: CWE-77
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.
Affected products
- macOS: from 10.6.8 before 10.7.5; from 10.8.0 before 10.8.2 — fixed in 10.7.5, 10.8.2
- Debian Linux: 6.0
- Fedoraproject Fedora: 39, 40
- Hewlett Packard Enterprise (HPE) HP-UX: b.11.23, b.11.31
- Opensuse: 11.4, 12.1
- PHP: before 5.3.12; from 5.4.0 before 5.4.2 — fixed in 5.3.12, 5.4.2
- RedHat Application Stack: 2.0
- RedHat Enterprise Linux Desktop: 6.0
- RedHat Enterprise Linux Eus: 5.6, 6.1, 6.2
- RedHat Enterprise Linux Server: 5.0, 6.0
- RedHat Enterprise Linux Server Aus: 5.3, 5.6
- RedHat Enterprise Linux Workstation: 5.0, 6.0
- RedHat Gluster Storage Server For On-Premise: 2.0
- RedHat Storage: 2.0
- RedHat Storage For Public Cloud: 2.0
- SUSE Linux Enterprise Server: 10-sp4, 11-sp2
- SUSE Linux Enterprise Software Development Kit: 10-sp4, 11-sp2
How to fix
Upgrade to a fixed version: macOS 10.7.5, 10.8.2; PHP 5.3.12, 5.4.2. Check the vendor advisory for mitigations.
In the news
References
- http://eindbazen.net/2012/05/php-cgi-advisory-cve-2012-1823/
- 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
Get alerted when CVE-2012-1823 or the next vulnerability affects your stack