CVE-2012-1823: PHP-CGI Query String Argument Injection
- Vendors
- Red HatDebian ProjectFedora ProjectHewlett Packard EnterpriseSuseAppleOpensusePHP Group
CVE-2012-1823 is an argument injection vulnerability affecting PHP before 5.3.12 and PHP 5.4.x before 5.4.2 when deployed through the CGI interface. Query strings lacking a literal equals sign can be passed to the PHP-CGI interpreter as command-line arguments. The CGI request handler fails to skip php_getopt processing appropriately, including processing of the -d option, allowing remote attackers to override PHP configuration directives. Injected options can expose PHP source code or cause attacker-supplied PHP code in an HTTP request body to execute. The vulnerability is not specific to Windows; CVE-2024-4577 is a later Windows-specific bypass of its protections.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Unauthenticated exploitation can disclose application source code and execute arbitrary PHP code or operating-system commands with the privileges of the PHP-CGI process. Resulting access can expose application credentials and data, permit modification of accessible files, and disrupt hosted services. The vulnerability has been exploited to deploy web shells, worms, botnet malware, and cryptocurrency miners, including on embedded Linux devices. It does not inherently provide root or administrator privileges.
Mitigation
If you can’t patch tonight, do this now.
Until updates can be applied, disable PHP-CGI execution or move to a non-CGI PHP deployment where feasible. Remove unnecessary CGI exposure and restrict access to affected endpoints to trusted networks. For affected Plesk deployments, prevent access from untrusted networks. Vulnerability-specific Cisco IPS and Snort signatures can provide interim detection or blocking; inline IPS blocking of exploitation attempts has been demonstrated. These controls do not replace patching.
Remediation
Patch, then assume compromise.
Apply the PHP security update supplied by the operating-system or product vendor. PHP 5.3.12 and 5.4.2 introduced the fixes for this CVE, but these branches are obsolete; migrate to a currently supported, fully patched PHP release rather than relying on those historical minimum versions. Amazon Linux installations should apply the fixed packages associated with ALAS-2012-77. For the affected Plesk integration, upgrade Parallels Plesk Panel 9.0–9.2.3 on Linux to at least 9.5.4, preferably a currently supported release, and ensure PHP is patched.
Exploits
9 exploits validated by Mallory's analysis. Hidden: 9 rejected by Mallory's analysis as not a working exploit; 3 not yet analyzed, such as Exploit-DB entries.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2012-1823 exploited in the wild?
- Yes. As of Nov 15, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Mar 25, 2022.
- Is there a public exploit for CVE-2012-1823?
- Yes. Mallory tracks 9 public exploits or proofs of concept for CVE-2012-1823, the earliest disclosed May 3, 2012.
- Is there a patch for CVE-2012-1823?
- Apply the PHP security update supplied by the operating-system or product vendor. PHP 5.3.12 and 5.4.2 introduced the fixes for this CVE, but these branches are obsolete; migrate to a currently supported, fully patched PHP release rather than relying on those historical minimum versions.
- What products are affected by CVE-2012-1823?
- PHP Group Php, Red Hat Application Stack, Debian Project Debian Linux, Red Hat Enterprise Linux Desktop, Red Hat Enterprise Linux Eus, and 12 more.
- How severe is CVE-2012-1823?
- CVE-2012-1823 has a CVSS v3.1 score of 9.8 (Critical) and an EPSS score of 100.0% (100th percentile) as of Nov 15, 2026.
Recent activity
29 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.