CVE-2012-1823PHP-CGI Query String Parameter Vulnerability
CVSS score
9.8
Critical
CVSS 3.1 from 134c704f-9b21-4f2e-91b3-4a467353bcc0
Exploit probability (EPSS)
100.0%
100.0% chance of exploitation in the next 30 days, higher than 100.0% of all CVEs.
CISA KEV
Actively exploited
Added to KEV on 25 Mar 2022.
US federal deadline to fix: 15 Apr 2022.
Official 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.
Source: NVD · CNA: cret@cert.org
How to fix it, step by step
Treat it as urgent
Attackers are already exploiting this flaw: CISA added it to its Known Exploited Vulnerabilities list on 25 Mar 2022.
US federal agencies must fix it by 15 Apr 2022. It's a sensible deadline for everyone else too.
CISA's full instruction
Apply updates per vendor instructions.
Check whether you're affected
Find every system running Php, fedoraproject Fedora, SUSE Linux Enterprise Server, Hp-ux, Opensuse and compare its version with the affected versions.
Update to a fixed version
- Update Php to 5.3.12, 5.4.2 or later, on the branch you run.
- Update Mac Os X to 10.7.5, 10.8.2 or later, on the branch you run.
If you can't update right away
Apply the workaround or mitigation in the vendor's advisory until you can update:
Check for signs of compromise
Updating closes the flaw but doesn't remove an attacker who got in earlier. Review affected systems for unknown accounts, unusual logins and configuration changes, and use any indicators of compromise the vendor or CISA publish.
Confirm the fix
Check that every affected system now reports a fixed version, and recheck the vendor's advisory: fixes are sometimes revised.
Was this useful?
How it can be exploited
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Values in red make the vulnerability easier to exploit or more damaging. CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Affected products
| Affected products | Versions |
|---|---|
| PHP Php | < 5.3.12 · ≥ 5.4.0, < 5.4.2 |
| fedoraproject Fedora | 39 · 40 |
| Debian Debian Linux | 6.0 |
| HP Hp-ux | b.11.23 · b.11.31 |
| opensuse Opensuse | 11.4 · 12.1 |
| SUSE Linux Enterprise Server | 10 · 11 |
| SUSE Linux Enterprise Software Development Kit | 10 · 11 |
| Apple Mac Os X | ≥ 10.6.8, < 10.7.5 · ≥ 10.8.0, < 10.8.2 |
| Red Hat Application Stack | 2.0 |
| Red Hat Gluster Storage Server For On-premise | 2.0 |
| Red Hat Storage | 2.0 |
| Red Hat Storage For Public Cloud | 2.0 |
| Red Hat Enterprise Linux Desktop | 6.0 |
| Red Hat Enterprise Linux Eus | 5.6 · 6.1 · 6.2 |
| Red Hat Enterprise Linux Server | 5.0 · 6.0 |
| Red Hat Enterprise Linux Server Aus | 5.3 · 5.6 |
| Red Hat Enterprise Linux Workstation | 5.0 · 6.0 |
Weakness
- CWE-77 command injection
Timeline
- Published:
- Added to CISA KEV:
- Last modified:
Frequently asked questions
Is CVE-2012-1823 being exploited?
Yes. CISA added CVE-2012-1823 to its Known Exploited Vulnerabilities catalog on 25 Mar 2022, which means there is evidence of exploitation in the wild. Its EPSS score estimates a 100.0% probability of exploitation in the next 30 days.
What is the CVSS score of CVE-2012-1823?
CVE-2012-1823 has a CVSS 3.1 base score of 9.8 (critical).
Which versions are affected?
PHP Php (< 5.3.12; ≥ 5.4.0, < 5.4.2), Fedoraproject Fedora (39; 40), Debian Debian Linux (6.0), HP Hp-ux (b.11.23; b.11.31), Opensuse Opensuse (11.4; 12.1), SUSE Linux Enterprise Server (10; 11)
Is there a patch for CVE-2012-1823?
The official record links to vendor advisories or patches; see “What to do” above.
References
- www.php.net/ChangeLog-5.php#5.4.2(Exploit, Patch, Release Notes)
- bugs.php.net/bug.php?id=61910(Exploit, Patch)
- bugs.php.net/patch-display.php?bug_id=61910&patch=cgi.diff&revision=1335984315&display=1(Patch)
- eindbazen.net/2012/05/php-cgi-advisory-cve-2012-1823/(Broken Link, Exploit)
- www.kb.cert.org/vuls/id/520827(Exploit, Third Party Advisory, US Government Resource)
- h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c03360041(Broken Link)
- lists.apple.com/archives/security-announce/2012/Sep/msg00004.html(Mailing List, Third Party Advisory)
- lists.opensuse.org/opensuse-security-announce/2012-05/msg00002.html(Mailing List, Third Party Advisory)
- lists.opensuse.org/opensuse-security-announce/2012-05/msg00007.html(Mailing List, Third Party Advisory)
- lists.opensuse.org/opensuse-security-announce/2012-05/msg00011.html(Mailing List, Third Party Advisory)
- marc.info/?l=bugtraq&m=134012830914727&w=2(Mailing List)
- rhn.redhat.com/errata/RHSA-2012-0546.html(Third Party Advisory)
- rhn.redhat.com/errata/RHSA-2012-0547.html(Third Party Advisory)
- rhn.redhat.com/errata/RHSA-2012-0568.html(Third Party Advisory)
- rhn.redhat.com/errata/RHSA-2012-0569.html(Third Party Advisory)
- rhn.redhat.com/errata/RHSA-2012-0570.html(Third Party Advisory)
- secunia.com/advisories/49014(Broken Link)
- secunia.com/advisories/49065(Broken Link)
- secunia.com/advisories/49085(Broken Link)
- secunia.com/advisories/49087(Broken Link)
Data: NVD, CVE.org (cvelistV5), CISA KEV and FIRST EPSS. Summary written by RedCVE with AI assistance from the official data.