sapi/cgi/cgi_main.c in PHP before 5.3.13 and 5.4.x before 5.4.3, when configured as a CGI script (aka php-cgi), does not properly handle que
sapi/cgi/cgi_main.c in PHP before 5.3.13 and 5.4.x before 5.4.3, when configured as a CGI script (aka php-cgi), does not properly handle query strings that contain a %3D sequence but no = (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. NOTE: this vulnerability exists because of an incomplete fix for CVE-2012-1823.
- Published
- May 11, 2012
- Updated
- Jun 16, 2026
- EPSS
- 69.3% · 99th percentile
- CWE
- CWE-89
Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.
Report tools
Action score
51
Plan
Add it to your regular patch cycle.
- CVSS
- 30 / 40 · 7.5 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 21 / 30 · 69.3%
Affected systems
| Vendor | Product | CPE |
|---|---|---|
| php | php | cpe:2.3:a:php:php |
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 phpup to 5.3.12 inclusive
- php php1.0
- php php2.0
- php php2.0b10
- php php3.0
- php php3.0.1
- php php3.0.10
- php php3.0.11
- php php3.0.12
- php php3.0.13
- php php3.0.14
- php php3.0.15
- php php3.0.16
- php php3.0.17
- php php3.0.18
- php php3.0.2
- php php3.0.3
- php php3.0.4
- php php3.0.5
- php php3.0.6
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 |
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-2012-1823sapi/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 queKEV99Now
- 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
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) |
Exploit status
Proof of concept available
A public proof of concept or detection signature exists. Exploit knowledge is out there; don't delay patching.
Evidence
- Exploit-DB entry ×4
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 |
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.
- First PoC-7 d
- Published
- 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
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- P · data can be read
- Integrity
- P · data or configuration can be modified
- Availability
- P · the service can be disrupted
- Attack complexity
- Low
- Confidentiality impact
- P
- Integrity impact
- P
- Availability impact
- P
Weakness class (CWE)
CWE-89 · Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')CVSS vector
AV:N/AC:L/Au:N/C:P/I:P/A:P
nvd-primary
Root cause
The query text is built by concatenating user input. The database cannot tell where the data ends and the command begins.
The bug in code
The whole CWE-89 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
const owner = req.query.owner;const rows = await db.query( "SELECT * FROM files WHERE owner = '" + owner + "'");Fixed
const owner = req.query.owner;const rows = await db.query( "SELECT * FROM files WHERE owner = $1", [owner]);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)
- Command Line Execution through SQL InjectionCAPEC-108likelihood: Low · Very High
- Object Relational Mapping InjectionCAPEC-109likelihood: Low · High
- SQL Injection through SOAP Parameter TamperingCAPEC-110likelihood: High · Very High
- Expanding Control over the Operating System from the DatabaseCAPEC-470Very High
- SQL InjectionCAPEC-66likelihood: High · High
- Blind SQL InjectionCAPEC-7likelihood: High · 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
- eindbazen.net/2012/05/php-cgi-advisory-cve-2012-1823/
- 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
- secunia.com/advisories/49014
- secunia.com/advisories/49085
- support.apple.com/kb/HT5501
- www.debian.org/security/2012/dsa-2465
- www.kb.cert.org/vuls/id/520827
- www.php.net/ChangeLog-5.php#5.4.3
- www.php.net/archive/2012.php#id2012-05-08-1
- www.securitytracker.com/id?1027022
- bugs.php.net/bug.php?id=61910
- bugs.php.net/patch-display.php?bug_id=61910&patch=cgi.diff-fix-check.patch&revision=1336093719&display=1
- h20564.www2.hp.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c03839862
Vendor advisories and official records. Exploit/PoC links are deliberately left out.