Live threats

All CVEs / PHP

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.

Source text, unmodified. NVD.

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.

Source text, unmodified. CISA KEV.

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.

  1. Apply the vendor's security update for PHP.
  2. CISA has confirmed it is exploited: treat it as urgent. The deadline for US federal agencies was April 15, 2022.
  3. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
  4. Check logs for signs of earlier exploitation.

Affected products (CPE)

VendorProductVersions
phpphp< 5.3.12
phpphp≥ 5.4.0 < 5.4.2
fedoraprojectfedora39
fedoraprojectfedora40
debiandebian_linux6.0
hphp-uxb.11.23
hphp-uxb.11.31
opensuseopensuse11.4
opensuseopensuse12.1
suselinux_enterprise_server10
suselinux_enterprise_server11
suselinux_enterprise_server11
suselinux_enterprise_software_development_kit10
suselinux_enterprise_software_development_kit11
applemac_os_x≥ 10.6.8 < 10.7.5
applemac_os_x≥ 10.8.0 < 10.8.2
redhatapplication_stack2.0
redhatgluster_storage_server_for_on-premise2.0
redhatstorage2.0
redhatstorage_for_public_cloud2.0
redhatenterprise_linux_desktop6.0
redhatenterprise_linux_eus5.6
redhatenterprise_linux_eus6.1
redhatenterprise_linux_eus6.2
redhatenterprise_linux_server5.0
redhatenterprise_linux_server6.0
redhatenterprise_linux_server_aus5.3
redhatenterprise_linux_server_aus5.6
redhatenterprise_linux_workstation5.0
redhatenterprise_linux_workstation6.0

Official sources

References

Links published by the sources. Open them with care.