CVE-2012-1823 in Apple Mac Os X and 16 more products
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 o...
Affects 17 products from 8 vendors. Facts below cite their sources.
Remotely exploitable over the network, low complexity, no authentication required, no user interaction needed, impact contained to the vulnerable component, full confidentiality impact, full integrity impact, full availability impact.
Affected products and versions
| Vendor | Product | Affected versions |
|---|---|---|
| Apple | Mac Os X | ≥ 10.6.8, < 10.7.5 ≥ 10.8.0, < 10.8.2 |
| Debian | Debian Linux | 6.0 |
| Fedoraproject | Fedora | 39 40 |
| Hp | Hp-Ux | b.11.23 b.11.31 |
| Opensuse | Opensuse | 11.4 12.1 |
| Php | Php | < 5.3.12 ≥ 5.4.0, < 5.4.2 |
| Redhat | Enterprise Linux Server Aus | 5.3 5.6 |
| Redhat | Storage | 2.0 |
| Redhat | Storage For Public Cloud | 2.0 |
| Redhat | Application Stack | 2.0 |
| Redhat | Gluster Storage Server For On-Premise | 2.0 |
| Redhat | Enterprise Linux Workstation | 5.0 6.0 |
| Redhat | Enterprise Linux Desktop | 6.0 |
| Redhat | Enterprise Linux Server | 5.0 6.0 |
| Redhat | Enterprise Linux Eus | 5.6 6.1 6.2 |
| Suse | Linux Enterprise Software Development Kit | 10 11 |
| Suse | Linux Enterprise Server | 10 11 |
A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.
Fix and vendor advisory
No official vendor advisory link on record. See the CVE record.
Exploitation
| CISA known-exploited | Yes added 2022-03-25 |
|---|---|
| Public exploit | Reported · reference |
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: NIST NVD / MITRE CVE.
Record details
| CVE ID | CVE-2012-1823 |
|---|---|
| BreachSpider ID | BS-2012-GLOBAL-180114-C |
| CVSS vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| Published | 2012-05-11 |
| Last modified | 2026-06-16 |
| Weakness (CWE) | |
| Source | NVD |
Weakness definitions
CWE-77: Command Injection
Attacker injects operating system commands through application inputs passed to a shell or system call.
Related attack patterns (CAPEC)
CAPEC-43 Exploiting Multiple Input Interpretation Layers via CWE-77
CAPEC-76 Manipulating Web Input to File System Calls via CWE-77
CAPEC-15 Command Delimiters via CWE-77
CAPEC-40 Manipulating Writeable Terminal Devices via CWE-77
CAPEC-75 Manipulating Writeable Configuration Files via CWE-77
Show all 8
CAPEC-136 LDAP Injection via CWE-77
CAPEC-183 IMAP/SMTP Command Injection via CWE-77
CAPEC-248 Command Injection via CWE-77
Mapping is CWE to CAPEC per MITRE CAPEC 3.9.
Analysis AI-written, not human-reviewed
CVE-2012-1823 affects PHP versions prior to 5.3.12 and 5.4.2 when configured as a CGI script. It allows remote attackers to execute arbitrary code by manipulating query strings, leading to potential system compromise. This vulnerability has a high CVSS score of 9.8 and is listed in the KEV catalog with public proof-of-concept and exploits available.
The vulnerability arises from the improper handling of query strings that lack an equals sign (=) character. Attackers can exploit this by placing command-line options in the query string, which can lead to the execution of arbitrary code on the affected system. This can result in full system compromise, data theft, and service disruption.
Compensating controls AI-drafted, review before use
Implement strict input validation and sanitization for all query strings processed by the PHP CGI script. Consider using a web application firewall (WAF) to filter out suspicious requests.
NERC CIP: CIP-007 CIP-007-R2
IEC 62443: SR 7.6
Not validated for your network. A compensating control does not replace the vendor fix.
Questions
What is CVE-2012-1823?
CVE-2012-1823 affects PHP versions prior to 5.3.12 and 5.4.2 when configured as a CGI script. It allows remote attackers to execute arbitrary code by manipulating query strings, leading to potential system compromise. This vulnerability has a high CVSS score of 9.8 and is listed in the KEV catalog with public proof-of-concept and exploits available.
What is the CVSS score for CVE-2012-1823?
CVE-2012-1823 has CVSS 9.8 (Critical). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H. EPSS: 100.0%.
Is CVE-2012-1823 actively exploited?
Yes. CVE-2012-1823 is in the CISA known-exploited catalog (added 2022-03-25). Active exploitation confirmed. Immediate patching required.
How do I remediate CVE-2012-1823?
Priority: IMMEDIATE.
What systems are affected by CVE-2012-1823?
CVE-2012-1823 affects Apple Mac Os X; Debian Debian Linux; Fedoraproject Fedora; Hp Hp-Ux; Opensuse Opensuse; Php Php; Redhat Enterprise Linux Server Aus, Storage, Storage For Public Cloud, Application Stack (plus 7 more products across 1 more vendor).
What NERC-CIP standard applies to CVE-2012-1823?
NERC CIP CIP-007 CIP-007-R2: This vulnerability could allow unauthorized access to critical systems, violating the requirement for securing electronic access to control systems.
What IEC 62443 requirement maps to CVE-2012-1823?
IEC 62443 SR 7.6: This vulnerability impacts the secure configuration of network devices and applications, which is essential for maintaining the integrity and availability of industrial control systems.
For developers and AI agents
Run this check from your own code or agent
REST API
curl -s https://breachspider.com/api/v1/assets/correlate-cves \
-H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"assets":[{"asset_id":"dev-1","vendor":"Apple","product":"Mac Os X","version":"1.0"}]}'
MCP for AI agents
# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp
Free trial: 14 days, 750 device checks, no card.
Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2026-06-16.