CVE-2012-1823PHP
Remote Code Execution in PHP-CGI via Improper Query String Handling
Critical 9.8 KEV No auth neededHigh EPSS
- Priority
- 84
- CVSS 3.1
- 9.8
- EPSS
- 100.0% probability of exploitation in 30 days · percentile 100
- Auth required
- No
- In KEV since
- Mar 25, 2022
- CISA deadline
- Apr 15, 2022
- Ransomware use
- Unknown
- Published
- May 11, 2012
- Updated
- Jun 16, 2026
- Category
- Web application · Cross-platform
- Weakness (CWE)
- CWE-77
- SSVC (CISA)
- Exploitation: active · Automatable: yes · Technical impact: total
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
What happens
PHP versions before 5.3.12 and 5.4.x before 5.4.2, when configured as CGI, do not properly handle query strings lacking an equals sign, allowing remote attackers to execute arbitrary code. CISA confirmed this vulnerability as actively exploited.
AI-generated summary (Claude) based on NVD and CISA data. Not reviewed yet: check the details in the vendor advisory.
Show the original NVD 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.
Exploitation confirmed by CISA
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.
Action required by CISA: Apply updates per vendor instructions.
What to do
Patch available · fixed versions: 5.3.12, 5.4.2
Update PHP to version 5.3.12 or later, or 5.4.2 or later depending on your branch. Apply the patch available in the official PHP repository.
Vendor advisory · www.php.net ↗
AI-generated from public data; not reviewed.
- Apply the vendor's security update for PHP.
- CISA has confirmed it is exploited: treat it as urgent. The deadline for US federal agencies was April 15, 2022.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
- Check logs for signs of earlier exploitation.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| php | php | < 5.3.12 |
| php | php | ≥ 5.4.0 < 5.4.2 |
| fedoraproject | fedora | 39 |
| fedoraproject | fedora | 40 |
| debian | debian_linux | 6.0 |
| hp | hp-ux | b.11.23 |
| hp | hp-ux | b.11.31 |
| opensuse | opensuse | 11.4 |
| opensuse | opensuse | 12.1 |
| suse | linux_enterprise_server | 10 |
| suse | linux_enterprise_server | 11 |
| suse | linux_enterprise_server | 11 |
| suse | linux_enterprise_software_development_kit | 10 |
| suse | linux_enterprise_software_development_kit | 11 |
| apple | mac_os_x | ≥ 10.6.8 < 10.7.5 |
| apple | mac_os_x | ≥ 10.8.0 < 10.8.2 |
| redhat | application_stack | 2.0 |
| redhat | gluster_storage_server_for_on-premise | 2.0 |
| redhat | storage | 2.0 |
| redhat | storage_for_public_cloud | 2.0 |
| redhat | enterprise_linux_desktop | 6.0 |
| redhat | enterprise_linux_eus | 5.6 |
| redhat | enterprise_linux_eus | 6.1 |
| redhat | enterprise_linux_eus | 6.2 |
| redhat | enterprise_linux_server | 5.0 |
| redhat | enterprise_linux_server | 6.0 |
| redhat | enterprise_linux_server_aus | 5.3 |
| redhat | enterprise_linux_server_aus | 5.6 |
| redhat | enterprise_linux_workstation | 5.0 |
| redhat | enterprise_linux_workstation | 6.0 |
Official sources
References
Links published by the sources. Open them with care.
- eindbazen.net Broken Link Exploit
- h20000.www2.hp.com Broken Link
- lists.apple.com Mailing List Third Party Advisory
- lists.opensuse.org Mailing List Third Party Advisory
- lists.opensuse.org Mailing List Third Party Advisory
- lists.opensuse.org Mailing List Third Party Advisory
- marc.info Mailing List
- rhn.redhat.com Third Party Advisory
- rhn.redhat.com Third Party Advisory
- rhn.redhat.com Third Party Advisory
- rhn.redhat.com Third Party Advisory
- rhn.redhat.com Third Party Advisory
- secunia.com Broken Link
- secunia.com Broken Link
- secunia.com Broken Link
- secunia.com Broken Link
- support.apple.com Third Party Advisory
- www.debian.org Third Party Advisory
- www.kb.cert.org Exploit Third Party Advisory US Government Resource
- www.kb.cert.org Third Party Advisory US Government Resource
- www.mandriva.com Broken Link
- www.openwall.com Mailing List
- www.php.net Exploit Patch Release Notes
- www.php.net Release Notes
- www.securitytracker.com Broken Link Third Party Advisory VDB Entry
- bugs.php.net Exploit Patch
- bugs.php.net Patch
- lists.fedoraproject.org Mailing List Release Notes
- lists.fedoraproject.org Mailing List Release Notes
- lists.fedoraproject.org Mailing List Release Notes
- www.cisa.gov US Government Resource