Free and open · new CVEs checked every 20 minutesStatusRSSOpen dataContact

CVE-2012-1823: PHP-CGI Query String Parameter Vulnerability

100
Patch now
CRITICAL 9.8EXPLOITEDREMOTEWATCHLISTUPGRADEMITIGATEMITIGATE

CVE-2012-1823 is a critical-severity flaw (CVSS 9.8) affecting php, fedora, debian linux, reported as exploited in the wild. Below: why it ranks where it does, which versions are affected, what to do, and the exact commands.

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.

Why this priority

  • Critical severity
  • EPSS top 1%: very likely to be exploited
  • Exploited in the wild (CISA KEV)
  • Public exploit reference
  • CISA SSVC: automatable with total technical impact
  • Remotely exploitable, no login, no user action
  • On your watchlist

A fixed release or distro patch exists.

Risk facts

CVSS score9.8 (Critical)
Attack vectorNetwork (remote)
Attack complexityLow
Privileges neededNone
User interactionNone
EPSS exploit chance100.0% (top 1%)
CISA exploited listYes, fix due 2022-04-15
WeaknessCWE-77
Published2012-05-11
Last modified2026-06-16
Publisher (CNA): CERT/CC · Vendor: debian · fedoraproject · hp · opensuse · php · suse

Share: LinkedIn · X · Reddit

Last updated 2026-06-16 · Sources: CVE Program, NVD, CISA KEV, EPSS and vendor advisories · How we score

Am I affected?

Timeline

php php UPGRADE
Affected: < 5.3.12 · >= 5.4.0 and < 5.4.2
Fixed in: 5.3.12, 5.4.2
Safe to downgrade to: a release before 5.4.0
1. Check installed version
apt-cache policy php || rpm -q php || php --version
2. UPGRADE to 5.3.12 (Debian / Ubuntu)
sudo apt update && sudo apt install --only-upgrade php
2. UPGRADE (RHEL / Amazon Linux / Fedora)
sudo dnf upgrade php
Note
Distros often backport fixes without changing the version number. Confirm with the distro advisory or changelog.
3. If no update is available yet, DOWNGRADE to a release before 5.4.0 (Debian / Ubuntu)
apt-cache madison php sudo apt install php=<VERSION_BEFORE_5.4.0> sudo apt-mark hold php
3. If no update is available yet, DOWNGRADE (RHEL / Amazon Linux / Fedora)
dnf --showduplicates list php sudo dnf downgrade php-<VERSION_BEFORE_5.4.0> sudo dnf versionlock add php
Downgrade risk
Downgrading can break dependent software and may reopen older bugs. Read the distro advisory first and test on a non-production host.
After downgrade
Restart the service, and keep the package held until a fixed release ships.
fedoraproject fedora MITIGATE
Affected: 39 · 40
Fixed in: no fixed release known
Safe to downgrade to: a release before 39
Check your OS release
cat /etc/os-release; uname -r
Debian / Ubuntu
sudo apt update && sudo apt full-upgrade
RHEL / Amazon Linux / Fedora
sudo dnf upgrade --refresh
Windows
Install the latest cumulative update from Windows Update
If no patch exists yet
OS downgrades are not safe. Apply the vendor mitigation from the advisory and restrict exposure.
debian debian linux MITIGATE
Affected: 6.0
Fixed in: no fixed release known
Safe to downgrade to: a release before 6.0
Check your OS release
cat /etc/os-release; uname -r
Debian / Ubuntu
sudo apt update && sudo apt full-upgrade
RHEL / Amazon Linux / Fedora
sudo dnf upgrade --refresh
Windows
Install the latest cumulative update from Windows Update
If no patch exists yet
OS downgrades are not safe. Apply the vendor mitigation from the advisory and restrict exposure.
hp hp-ux MITIGATE
Affected: b.11.23 · b.11.31
Fixed in: no fixed release known
Safe to downgrade to: a release before b.11.23
Check your OS release
cat /etc/os-release; uname -r
Debian / Ubuntu
sudo apt update && sudo apt full-upgrade
RHEL / Amazon Linux / Fedora
sudo dnf upgrade --refresh
Windows
Install the latest cumulative update from Windows Update
If no patch exists yet
OS downgrades are not safe. Apply the vendor mitigation from the advisory and restrict exposure.
opensuse opensuse MITIGATE
Affected: 11.4 · 12.1
Fixed in: no fixed release known
Safe to downgrade to: a release before 11.4
Check your OS release
cat /etc/os-release; uname -r
Debian / Ubuntu
sudo apt update && sudo apt full-upgrade
RHEL / Amazon Linux / Fedora
sudo dnf upgrade --refresh
Windows
Install the latest cumulative update from Windows Update
If no patch exists yet
OS downgrades are not safe. Apply the vendor mitigation from the advisory and restrict exposure.
suse linux enterprise server MITIGATE
Affected: 10 sp4
Fixed in: no fixed release known
Safe to downgrade to: a release before 10
Check your OS release
cat /etc/os-release; uname -r
Debian / Ubuntu
sudo apt update && sudo apt full-upgrade
RHEL / Amazon Linux / Fedora
sudo dnf upgrade --refresh
Windows
Install the latest cumulative update from Windows Update
If no patch exists yet
OS downgrades are not safe. Apply the vendor mitigation from the advisory and restrict exposure.

Exact fixes by distribution

A distro patch exists: prefer upgrading over downgrading.
Fedora 46 · dupeguru · FIXED · 4.3.1^20261101git7a2c79f-1.fc46 · FEDORA-2026-fe4523382c · source
sudo dnf upgrade --advisory=FEDORA-2026-fe4523382c
Fedora ELN · openexr · FIXED · 3.4.13-3.eln159 · FEDORA-2026-827a613db5 · source
sudo dnf upgrade --advisory=FEDORA-2026-827a613db5
RHEL 5 · php · FIXED · php-5.1.6-34.el5_8
sudo dnf upgrade --advisory=RHSA-2012:0546 rpm -q php
RHEL 5 · php53 · FIXED · php53-5.3.3-7.el5_8
sudo dnf upgrade --advisory=RHSA-2012:0547 rpm -q php53
RHEL 5.3 Long Life · php · FIXED · php-5.1.6-23.3.el5_3
sudo dnf upgrade --advisory=RHSA-2012:0568 rpm -q php
RHEL 5.6 EUS - Server Only · php · FIXED · php-5.1.6-27.el5_6.4
sudo dnf upgrade --advisory=RHSA-2012:0568 rpm -q php
RHEL 5.6 EUS - Server Only · php53 · FIXED · php53-5.3.3-1.el5_6.2
sudo dnf upgrade --advisory=RHSA-2012:0569 rpm -q php53
Amazon Linux 1 · see advisory · FIXED · ALAS-2012-77 · source
sudo yum update --advisory=ALAS-2012-77

Public exploits and detection

Public code exists for this CVE. Treat unpatched systems as at risk, and only run PoCs in a lab.

Advisories and coverage

Research and news

Verify at the official source NVD · CVE Program · CISA KEV catalog · Report a problem with this page
Scores and fixes here are computed automatically from those and other public sources. Confirm with the vendor advisory before changing production systems.

Quick answers

How do I fix CVE-2012-1823?

php: upgrade to 5.3.12, 5.4.2; fedora: mitigate or apply the listed mitigation; debian linux: mitigate or apply the listed mitigation. Exact commands for each OS are on this page.

Is CVE-2012-1823 being exploited?

Yes. CVE-2012-1823 is on the CISA Known Exploited Vulnerabilities list, so treat it as patch-now.

What does CVE-2012-1823 affect?

CVE-2012-1823 affects php, fedora, debian linux. Severity is critical (CVSS 9.8). 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 arbitrar

How urgent is CVE-2012-1823?

Priority 100/100. Critical severity; EPSS top 1%: very likely to be exploited; Exploited in the wild (CISA KEV); Public exploit reference; CISA SSVC: automatable with total technical impact; Remotely exploitable, no login, no user action; On your watchlist

Software pages

PHP vulnerabilities · Debian vulnerabilities

Related CVEs

References

← Back to latest CVEs

Get the weekly exploited-CVE digest by emailThe CVEs being attacked this week and how to fix them. No spam, unsubscribe any time.