Command injectionin PHP.
On CISAThe US cyber defence agency. Its list names every hole it has seen used in real attacks.'s exploited list since 12 Jun 2024. Ransomware groups use it too.
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.
CISA: 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.
- Upgrade PHP to 8.1.29, 8.2.20, 8.3.8 or later, whichever matches your release line.
- CISA requires US federal agencies to fix it by 3 Jul 2024.
Affected and fixed versions
From the CVE record, NVD and package advisories. When no source has versions yet, this table says "not confirmed" instead of guessing.
From first report to first attacks
- 6 May 2024CVE ID reserved by php.
- 6 Jun 2024Metasploit module: PHP CGI Argument Injection Remote Code Execution.
- 7 Jun 2024First public proof of concept on GitHub.
- 9 Jun 2024Published in the CVE List.
- 12 Jun 2024Added to CISA's Known Exploited Vulnerabilities list.
- 12 Jun 2024CISA lists known use in ransomware campaigns.
- 21 Oct 2025CVE record last updated.
Attack code anyone can find
Exploit maturity: Exploited in the wild (CISA KEV). CISA assessment (SSVC): exploitation active.
Listed so defenders can judge how urgent this is and test systems they are authorised to test. Patchminder does not host exploit code; links open the source page. Labels for GitHub repositories come from their public details and are never a promise about the code. Run anything only in an isolated lab.
Report a link
Other PHP vulnerabilities
Same weakness: OS command injection
- github.com
- blog.orange.tw
- devco.re
- arstechnica.com
- www.imperva.com
- github.com
- github.com
- github.com
- labs.watchtowr.com
- github.com
- www.php.net
- www.php.net
- www.php.net
- cert.be
- isc.sans.edu
- www.openwall.com
- lists.fedoraproject.org
- lists.fedoraproject.org
- security.netapp.com
- www.cisa.gov government-resource
- www.vicarius.io
- www.vicarius.io
- blog.talosintelligence.com
Patchminder. CVE-2024-4577: Command injection in PHP. https://patchminder.com/cve/cve-2024-4577/ (accessed 5 December 2026).