CVE-2012-1823
CRITICALsapi/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,…
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
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.
Affected Products
mac os xappledebian linuxdebianfedorafedoraprojecthp-uxhpopensuseopensusephpphpResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Apache + PHP < 5.3.12 / < 5.4.2 - cgi-bin Remote Code Execution
by kingcope · Oct 29, 2013
Apache + PHP < 5.3.12 / < 5.4.2 - Remote Code Execution + Scanner
by noptrix · Oct 31, 2013
PHP 5.3.12/5.4.2 - CGI Argument Injection (Metasploit)
by Metasploit · May 4, 2012
PHP < 5.3.12 / < 5.4.2 - CGI Argument Injection
by rayh4c · May 5, 2012
Detection & mitigation playbook
Vendor / applianceDetect
Inventory every apple mac os x deployment and check each version against the affected-products list above. Because the exploit targets the running system rather than your application code, also watch for remote code execution at the network and runtime layer — O3 flags the exploit behaviour from runtime telemetry and egress traffic even before a vulnerable build is confirmed.
Fix
Apply the apple mac os x security patch or hotfix for CVE-2012-1823 on the affected version, following the vendor advisory for your exact build.
Workarounds
Cut exposure now: restrict the management/admin interface to trusted networks, segment the device, and apply the vendor's recommended configuration mitigations and any WAF/IPS signature. O3's runtime protection blocks the exploit chain at execution, holding the line on unpatched or end-of-life systems until you can patch.
How O3 protects you
O3 detects and blocks CVE-2012-1823 exploitation at runtime: eBPF exploit-chain detection, plus L7 egress monitoring that catches the post-exploitation callback and severs the attacker's outbound channel.
Tailored to CVE-2012-1823. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is CVE-2012-1823 being exploited in your environment?
O3's eBPF runtime sensors and L7 egress monitoring detect and block the CVE-2012-1823 exploit chain at execution — protecting unpatched and end-of-life systems until the vendor patch is applied.