Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🛡️
CISA KEV · ACTIVELY EXPLOITED
CRITICAL severity

CVE-2012-1823 — Red Hat

CRITICAL

CVE-2012-1823 is a critical-severity (CVSS 9.8) CWE-77 vulnerability. It is in CISA's Known Exploited Vulnerabilities catalog (added 2022-03-25) — treat it as actively exploited and patch now. No vendor fix is recorded yet; mitigation options are listed below.

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,…

Published
Updated
Affected
17 products
Patched
See advisory
Exploits
18 known
Exploitation data as of Oct 22, 2026 · OSV.dev, NVD, CISA KEV, FIRST.org (EPSS)

Exploitation Status

Actively exploited in the wild

  • Confirmed by CISA's Known Exploited Vulnerabilities catalog on 2022-03-25. Federal agencies were required to remediate by 2022-04-15.
  • CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
  • A successful exploit gives an attacker total control of the affected component, not partial access.

Exploitation and automatability from CISA (KEV catalog and SSVC triage) for CVE-2012-1823.

EPSS Exploitation Probability

via FIRST.org ↗
100.0%probability of exploitation in next 30 days
Very High Risk0.00%
Lower risk than most CVEs100th percentile — riskier than 100% of all scored CVEsHighest risk
92.7%95.1%97.6%100.0%94.4%94.4%100.0%100.0%100.0%Apr 26Aug 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

CVE-2012-1823 by exploitation likelihood (EPSS) against impact (CVSS). In the shaded patch-first corner (EPSS 50%+, CVSS 7.0+).

Where this sits among everything scored

Of 395,249 CVEs with a current EPSS score, this one falls in the ≥ 90% band (highlighted). Counts from FIRST.org, log-scaled.

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

17 products · 30 configurations
OS
mac os xapple
≥ 10.8.0 && < 10.8.2
range
OS
debian linuxdebian
1 version
6.0
OS
fedorafedoraproject
2 versions
3940
OS
hp-uxhp
2 versions
b.11.23b.11.31
OS
opensuseopensuse
2 versions
11.412.1
Application
phpphp
≥ 5.4.0 && < 5.4.2
range
Exploits & PoCs
18

Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.

EDB-29290remotephp✓ Verified

Apache + PHP < 5.3.12 / < 5.4.2 - cgi-bin Remote Code Execution

by kingcope · Oct 29, 2013

EDB-29316remotephp

Apache + PHP < 5.3.12 / < 5.4.2 - Remote Code Execution + Scanner

by noptrix · Oct 31, 2013

EDB-18836remotephp✓ Verified

PHP < 5.3.12 / < 5.4.2 - CGI Argument Injection

by rayh4c · May 5, 2012

EDB-18834remotephp✓ Verified

PHP 5.3.12/5.4.2 - CGI Argument Injection (Metasploit)

by Metasploit · May 4, 2012

Detection & mitigation playbook

Vulnerability
  1. Detect

    Identify every host running the affected component and compare the installed build against the fixed version below — for source-built or distro-packaged software the version string, not a lockfile, is the source of truth (`dpkg -l`, `rpm -q`, or the binary's own `--version`).

  2. Remediation status

    No fixed release is recorded for CVE-2012-1823 yet. Track the upstream advisory, and apply the exposure-reduction steps below in the meantime.

  3. Mitigate without a patch

    Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.

How to detect CVE-2012-1823

A community-maintained Nuclei template exists for this CVE. You can scan for it directly:

nuclei -id cve-2012-1823 -u https://target
Template
PHP CGI v5.3.12/5.4.2 Remote Code Execution
Severity
high
Impact
Remote code execution
Remediation
Upgrade to a patched version of PHP or apply the necessary security patches.

Template by ProjectDiscovery nuclei-templates (pikpikcu), MIT licensed. View the full template. Scan only systems you are authorised to test.

Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatCritical

This flaw did not affect the versions of PHP in Red Hat Enterprise Linux 3 or 4. Updates were released for Red Hat Enterprise Linux 5 and 6 (RHSA-2012:0546, RHSA-2012:0547), Red Hat Enterprise Linux 5.3 Long Life (RHSA-2012:0568), Red Hat Enterprise Linux 5.6, 6.0, and 6.1 Extended Update Support (RHSA-2012:0568,…

ProductFixed inAdvisory
Red Hat Enterprise Linux 5php-0:5.1.6-34.el5_8RHSA-2012:0546
Red Hat Enterprise Linux 5php53-0:5.3.3-7.el5_8RHSA-2012:0547
Red Hat Enterprise Linux 5.3 Long Lifephp-0:5.1.6-23.3.el5_3RHSA-2012:0568
Red Hat Enterprise Linux 5.6 EUS - Server Onlyphp53-0:5.3.3-1.el5_6.2RHSA-2012:0569
UbuntuCRITICAL

Frequently Asked Questions

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.
O3 Security · Impact-Aware SCA

Is CVE-2012-1823 in your dependencies?

Find it across , including transitive dependencies.

CVE-2012-1823: Red Hat Command Injection (KEV)