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 que
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.
- Published
- May 11, 2012
- Updated
- Jun 16, 2026
- EPSS
- 100.0% · 100th percentile
- CWE
- CWE-77
Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.
Report tools
Action score
99
Now
Patch today or shut off access.
- CVSS
- 39 / 40 · 9.8 / 10
- CISA KEV
- 30 / 30 · Listed
- EPSS
- 30 / 30 · 100.0%
CISA SSVC decision
- Exploitation
- active
- Automatable
- yes
- Technical impact
- total
Vulnrichment: CISA's decision-tree inputs.
Actively exploited in the wild
CISA added this to its Known Exploited Vulnerabilities catalog on Mar 25, 2022. That signals real attacks, not theory.
Remediation deadline for government agencies: Apr 15, 2022.
Affected systems
| Vendor | Product | CPE |
|---|---|---|
| php | php | cpe:2.3:a:php:php |
| fedoraproject | fedora | cpe:2.3:o:fedoraproject:fedora |
| debian | debian linux | cpe:2.3:o:debian:debian_linux |
| hp | hp-ux | cpe:2.3:o:hp:hp-ux |
| opensuse | opensuse | cpe:2.3:o:opensuse:opensuse |
| suse | linux enterprise server | cpe:2.3:o:suse:linux_enterprise_server |
| suse | linux enterprise software development kit | cpe:2.3:o:suse:linux_enterprise_software_development_kit |
| apple | mac os x | cpe:2.3:o:apple:mac_os_x |
| redhat | application stack | cpe:2.3:a:redhat:application_stack |
| redhat | gluster storage server for on-premise | cpe:2.3:a:redhat:gluster_storage_server_for_on-premise |
| redhat | storage | cpe:2.3:a:redhat:storage |
| redhat | storage for public cloud | cpe:2.3:a:redhat:storage_for_public_cloud |
and 5 more
Using php? Add it to your stack and be the first to know about CVEs like this one. (PHP)
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- php phpbefore 5.3.12
- php php5.4.0 and later · before 5.4.2
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Debian:6.0 | php5 | before 5.3.3-7+squeeze9 | 5.3.3-7+squeeze9 |
| Red Hat:enterprise_linux:5::client_workstation | php | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-bcmath | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-cli | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-common | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-dba | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-debuginfo | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-devel | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-gd | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-imap | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-ldap | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-mbstring | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-mysql | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-ncurses | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-odbc | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-pdo | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-pgsql | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-snmp | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-soap | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-xml | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php-xmlrpc | before 0:5.1.6-34.el5_8 | 0:5.1.6-34.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php53 | before 0:5.3.3-7.el5_8 | 0:5.3.3-7.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php53-bcmath | before 0:5.3.3-7.el5_8 | 0:5.3.3-7.el5_8 |
| Red Hat:enterprise_linux:5::client_workstation | php53-cli | before 0:5.3.3-7.el5_8 | 0:5.3.3-7.el5_8 |
+96
Same product
php: all recordsOther highest-scoring records for the same primary product.
- CVE-2024-4577Argument Injection in PHP-CGIKEV99Now
- CVE-2019-11043Underflow in PHP-FPM can lead to RCEKEV99Now
- CVE-2018-7584In PHP through 5.6.33, 7.0.x before 7.0.28, 7.1.x through 7.1.14, and 7.2.x through 7.2.2, there is a stack-based buffer under-read while pa65This week
- CVE-2018-19518University of Washington IMAP Toolkit 2007f on UNIX, as used in imap_open() in PHP and other products, launches an rsh command (by means of 59Plan
- CVE-2016-3078Multiple integer overflows in php_zip.c in the zip extension in PHP before 7.0.6 allow remote attackers to cause a denial of service (heap-b56Plan
- CVE-2015-6834Multiple use-after-free vulnerabilities in PHP before 5.4.45, 5.5.x before 5.5.29, and 5.6.x before 5.6.13 allow remote attackers to execute53Plan
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| debian:php5 | 5.3.3-7+squeeze9 · Debian:6.0 | Package registry (OSV) |
| red hat:php | 0:5.1.6-34.el5_8 · Red Hat:enterprise_linux:5::client_workstation | Package registry (OSV) |
| red hat:php-bcmath | 0:5.1.6-34.el5_8 · Red Hat:enterprise_linux:5::client_workstation | Package registry (OSV) |
| red hat:php-cli | 0:5.1.6-34.el5_8 · Red Hat:enterprise_linux:5::client_workstation | Package registry (OSV) |
| red hat:php-common | 0:5.1.6-34.el5_8 · Red Hat:enterprise_linux:5::client_workstation | Package registry (OSV) |
| red hat:php-dba | 0:5.1.6-34.el5_8 · Red Hat:enterprise_linux:5::client_workstation | Package registry (OSV) |
| red hat:php-debuginfo | 0:5.1.6-34.el5_8 · Red Hat:enterprise_linux:5::client_workstation | Package registry (OSV) |
| red hat:php-devel | 0:5.1.6-34.el5_8 · Red Hat:enterprise_linux:5::client_workstation | Package registry (OSV) |
| red hat:php-gd | 0:5.1.6-34.el5_8 · Red Hat:enterprise_linux:5::client_workstation | Package registry (OSV) |
| red hat:php-imap | 0:5.1.6-34.el5_8 · Red Hat:enterprise_linux:5::client_workstation | Package registry (OSV) |
| red hat:php-ldap | 0:5.1.6-34.el5_8 · Red Hat:enterprise_linux:5::client_workstation | Package registry (OSV) |
| red hat:php-mbstring | 0:5.1.6-34.el5_8 · Red Hat:enterprise_linux:5::client_workstation | Package registry (OSV) |
| red hat:php-mysql | 0:5.1.6-34.el5_8 · Red Hat:enterprise_linux:5::client_workstation | Package registry (OSV) |
Exploit status
Weaponized
A ready exploit tool or active in-the-wild use is known for this vulnerability. This should be your top priority.
Evidence
- Metasploit module ×1
- Exploit-DB entry ×4
- Nuclei detection template ×1
- Proof-of-concept repository on GitHub ×14
Noroxi does not host or link to exploit code. Metasploit module names and Nuclei template ids are shown (names, not code); Exploit-DB entries and PoC repositories are given as counts only.
| Source | Kind | Date |
|---|---|---|
| Exploit-DB entry | remote | 2013-10-29 |
| Exploit-DB entry | remote | 2013-10-31 |
| Exploit-DB entry | remote | 2012-05-04 |
| Exploit-DB entry | remote | 2012-05-05 |
| Metasploit module | exploit/multi/http/php_cgi_arg_injectionPHP CGI Argument Injectionexploit | 2012-05-03 |
| Nuclei detection template | Nuclei template CVE-2012-1823 | — |
| Proof-of-concept repository on GitHub | stars:1 | 2015-09-08 |
| Proof-of-concept repository on GitHub | stars:3 | 2017-10-01 |
| Proof-of-concept repository on GitHub | stars:4 | 2019-07-05 |
| Proof-of-concept repository on GitHub | stars:1 | 2020-08-17 |
| Proof-of-concept repository on GitHub | stars:12 | 2023-08-24 |
| Proof-of-concept repository on GitHub | stars:0 | 2024-12-09 |
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
- Metasploit-8 d
- First PoC-7 d
- Published
- CISA KEV+3605 d
- TodaySep 30, 2026+5255 d
FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
No commit or PR link among the references.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
No nightly-computed relations.
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
No known public program.
Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- No user action is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- high · data can be read
- Integrity
- high · data or configuration can be modified
- Availability
- high · the service can be disrupted
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- High
- Integrity impact
- High
- Availability impact
- High
Weakness class (CWE)
CWE-77 · Improper Neutralization of Special Elements used in a Command ('Command Injection')CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
nvd-secondary
Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
- LDAP InjectionCAPEC-136likelihood: High · High
- Command DelimitersCAPEC-15likelihood: High · High
- IMAP/SMTP Command InjectionCAPEC-183Medium
- Command InjectionCAPEC-248likelihood: Medium · High
- Manipulating Writeable Terminal DevicesCAPEC-40likelihood: High · Very High
- Exploiting Multiple Input Interpretation LayersCAPEC-43likelihood: Medium · High
- Manipulating Writeable Configuration FilesCAPEC-75likelihood: High · Very High
- Manipulating Web Input to File System CallsCAPEC-76likelihood: High · Very High
ATT&CK techniques
—
Noroxi analysis
No Noroxi analysis for this record yet
We don't hand-write analysis for all 385,000+ vulnerabilities; that wouldn't be honest. For notable, high-impact vulnerabilities our team writes the mechanism, detection and remediation steps.
We use this product, ask for helpChange log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
- h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c03360041
- lists.apple.com/archives/security-announce/2012/Sep/msg00004.html
- lists.opensuse.org/opensuse-security-announce/2012-05/msg00002.html
- lists.opensuse.org/opensuse-security-announce/2012-05/msg00007.html
- lists.opensuse.org/opensuse-security-announce/2012-05/msg00011.html
- marc.info/?l=bugtraq&m=134012830914727&w=2
- rhn.redhat.com/errata/RHSA-2012-0546.html
- rhn.redhat.com/errata/RHSA-2012-0547.html
- rhn.redhat.com/errata/RHSA-2012-0568.html
- rhn.redhat.com/errata/RHSA-2012-0569.html
- rhn.redhat.com/errata/RHSA-2012-0570.html
- secunia.com/advisories/49014
- secunia.com/advisories/49065
- secunia.com/advisories/49085
- secunia.com/advisories/49087
- support.apple.com/kb/HT5501
- www.debian.org/security/2012/dsa-2465
- www.kb.cert.org/vuls/id/673343
- www.mandriva.com/security/advisories?name=MDVSA-2012:068
- www.openwall.com/lists/oss-security/2024/06/07/1
Vendor advisories and official records. Exploit/PoC links are deliberately left out.