CVE-2024-4577 PHP-CGI OS Command Injection Vulnerability
PHP, specifically Windows-based PHP used in CGI mode, contains an OS command injection vulnerability that allows for arbitrary code execution. This vulnerability is a patch bypass for CVE-2012-1823.
From the CISA KEV catalogue version 2026.11.06, with Cybergen analysis. Updated 6 Nov 2026.
Should You Worry?
- CISA confirmed exploitation in the wild and added it to the Known Exploited Vulnerabilities catalogue on 12 Jun 2024.
- CISA lists it as known to be used in ransomware campaigns.
- Rated Critical severity (CVSS 9.8, scored by Vendor).
- It has been in the catalogue for 877 days. Systems still unpatched now have almost certainly been scanned for it.
What It Is
In PHP versions 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8, when using Apache and PHP-CGI on Windows, if the system is set up to use certain code pages, Windows may use "Best-Fit" behavior to replace characters in command line given to Win32 API functions. PHP CGI module may misinterpret those characters as PHP options, which may allow a malicious user to pass options to PHP binary being run, and thus reveal the source code of scripts, run arbitrary PHP code on the server, etc.
Affected Versions
| Product | Versions |
|---|---|
| PHP Group PHP | 8.1.* to before 8.1.29 8.2.* to before 8.2.20 8.3.* to before 8.3.8 |
From the public CVE record, as supplied by the vendor. Always confirm against the vendor advisory.
What To Do Now
- 1
Find it
Search your asset inventory and external attack surface for PHP Group PHP. Include cloud images, appliances and anything a supplier runs for you.
Attack Surface Management - 2
Fix it
Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.
Vulnerability Management - 3
Hunt for compromise
If an affected system was reachable before you patched, assume it may have been hit. Check logs, new accounts, web shells and outbound connections from the date of exposure.
Incident Response - 4
Prove it is fixed
Rescan or test the system after patching. Upgrades that fail silently and forgotten secondary instances are common.
Penetration Testing
Vendor Advisories
The Compliance Clock
General guidance, not legal advice. Your obligations depend on your sector, scope and jurisdiction.
Not Sure If You Are Exposed?
Our attack surface and vulnerability teams can check your internet-facing estate for CVE-2024-4577 and every other exploited flaw on the list.
Sources
- CISA Known Exploited Vulnerabilities catalogue
- NVD: CVE-2024-4577
- CVE record: CVE-2024-4577
- FIRST EPSS
- github.com/php/php-src/security/advisories/GHSA-3qgc-jrrr-25jv
- blog.orange.tw/2024/06/cve-2024-4577-yet-another-php-rce.html
- devco.re/blog/2024/06/06/security-alert-cve-2024-4577-php-cgi-argument-injection-vulnerability-en/
- arstechnica.com/security/2024/06/php-vulnerability-allows-attackers-to-run-malicious-code-on-windows
- imperva.com/blog/imperva-protects-against-critical-php-vulnerability-cve-2024-4577/
- github.com/11whoami99/CVE-2024-4577
- github.com/xcanwin/CVE-2024-4577-PHP-RCE
- github.com/rapid7/metasploit-framework/pull/19247
