InfraGuard

CVE-2012-1823

9.8 CVSS 3.1 Exploited in the wildEPSS 100.0%

What is wrong

PHP improperly handles query strings in sapi/cgi/cgi_main.c when configured as a CGI script. This allows remote attackers to execute arbitrary code on the affected server.

Who is affected

This affects PHP configured as a CGI script in versions prior to 5.3.12 and versions 5.4.0 prior to 5.4.2.

What to do

Upgrade PHP to version 5.3.12 or 5.4.2 according to vendor instructions.

Original 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.

Known exploited (CISA KEV)

Added to KEV
2022-03-25
Remediation due (US federal)
2022-04-15
Ransomware use
Unknown
Required action
Apply updates per vendor instructions.

Affected software

Details

Published
2012-05-11
Last modified
2025-11-05
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS (30-day exploit probability)
100.00% (percentile 100)

References

Track these versions on your own servers

InfraGuard collects installed software versions from every server and flags the ones with known vulnerabilities. Self-hosted — nothing leaves your network.

Weekly exploited-vulnerability digest

The KEV additions that matter for self-hosted servers, once a week. No other mail.

This product uses data from the NVD API but is not endorsed or certified by the NVD. CVE® is a registered trademark of The MITRE Corporation; CVE records are used under the CVE Program Terms of Use.