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

CISA Known Exploited Vulnerabilities entry

Vulnerability namePHP-CGI Query String Parameter Vulnerability
Vendor / productPHP / PHP
Date added2022-03-25
Federal remediation due date2022-04-15
Required actionApply updates per vendor instructions.
Known ransomware campaign useUnknown

CISA SSVC decision points

Exploitationactive
Automatableyes
Technical impacttotal
Scored2025-02-07

Timeline

  1. 2012-05-04First Exploit-DB entry (EDB-ID 18834)7 days before publication
  2. 2012-05-11Published by the CNA10:00 UTC
  3. 2022-03-25Added to the CISA KEV catalog3605 days after publication
  4. 2025-02-07CISA SSVC decision recorded4655 days after publication

The timeline shows what already happened. To be told when this CVE changes next, watch it from the API.

Exploit and advisory records

Exploit-DBTypePlatformPublishedEDB-verified
EDB-ID 29290remotephp2013-10-29yes
EDB-ID 18836remotephp2012-05-05yes
EDB-ID 18834remotephp2012-05-04yes
EDB-ID 29316remotephp2013-10-31no

Nuclei templates:

Affected products

VendorProduct
applemac_os_x
debiandebian_linux
fedoraprojectfedora
hphp-ux
opensuseopensuse
phpphp
redhatapplication_stack
redhatenterprise_linux_desktop
redhatenterprise_linux_eus
redhatenterprise_linux_server
redhatenterprise_linux_server_aus
redhatenterprise_linux_workstation
redhatgluster_storage_server_for_on-premise
redhatstorage
redhatstorage_for_public_cloud
suselinux_enterprise_server
suselinux_enterprise_software_development_kit

References

31 references in total; the first 20 are shown.

Get more CVE data from the API.

Free without a key or signup. Pro adds monitoring and higher limits: pricing.

Sources