CVE-2024-4577
PHP-CGI OS Command Injection Vulnerability
- Actively exploited
- Used by ransomware
- Critical · 9.8 of 10
- Exploited since
- 12 Jun 2024 added to the CISA list
- Chance of attacks
- over 99.9% in the next 30 days (FIRST EPSS)
- Fix deadline
- 3 Jul 2024 for US federal agencies
- Published
- 9 Jun 2024 in the NVD
What this means
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.
CISA
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.
NIST National Vulnerability Database
What to do
Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.
CISA's required action. If you use the product, install the vendor's update as soon as possible.
Affected
- PHP Group PHP
- php_group php
Official sources
- nvd.nist.gov/vuln/detail/CVE-2024-4577
- openwall.com/lists/oss-security/2024/06/07/1
- arstechnica.com/security/2024/06/php-vulnerability-allows-attackers-to-run-malicious-code-...
- blog.orange.tw/2024/06/cve-2024-4577-yet-another-php-rce.html
- cert.be/en/advisory/warning-php-remote-code-execution-patch-immediately
- devco.re/blog/2024/06/06/security-alert-cve-2024-4577-php-cgi-argument-injection-vulnerabi...
- github.com/11whoami99/CVE-2024-4577
- github.com/php/php-src/security/advisories/GHSA-3qgc-jrrr-25jv
- github.com/rapid7/metasploit-framework/pull/19247
Data from the NIST National Vulnerability Database, the CISA Known Exploited Vulnerabilities list, FIRST EPSS and ENISA, checked 18 Nov 2026. CVSS vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.