CVE-2024-4577: PHP-CGI OS Command Injection Vulnerability
Vulnerability summary
CVE-2024-4577 is a critical (CVSS 9.8) vulnerability in PHP Group PHP. It is known to be exploited: CISA lists it, first on 12-06-2024. It has been used in ransomware campaigns. EPSS estimates a 99.99% chance of exploitation in the next 30 days, higher than 99.9% of scored vulnerabilities. 14 public exploits are recorded.
Known ransomware use (CISA, 12-06-2024)
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 1 · Related 4Timeline
- 09-06-2024PublishedVulnerability first disclosed.
- 12-06-2024Added to CISA KEVExploitedPHP-CGI OS Command Injection Vulnerability
- 03-07-2024CISA remediation dueDeadline passedApply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.
- 21-10-2025Last modifiedVulnerability information updated.
Description
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.
CVSS metrics
5 scores · 5 sources · 1 version- OSV · WolfiEcosystem advisory · calculated9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- OSV · ChainguardEcosystem advisory · calculated9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- NVDNIST9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- OSV · AlpineEcosystem advisory · calculated9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS trend
Probability
99.99%
Chance of exploitation in the next 30 days
Percentile
100%
Versus all other CVEs
30-day change
No change 0.00 pp
From 99.99% on 04-10-2026
Known exploited
Compare KEV catalogs- Added
- 12-06-2024
- Federal due date
- 03-07-2024
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
CISA required action
Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable. nvd.nist.gov/vuln/detail/CVE-2024-4577
Public exploits
14 foundPhp Src
Maturity: poc
Cve 2024 4577
Maturity: poc
Cve 2024 4577 Php Rce
Maturity: poc
Show all 14 exploits
Metasploit Framework
Maturity: poc
Cve 2024 4577
Maturity: poc
Exploit Reference (devco.re)
Maturity: unknown
Exploit Reference (arstechnica.com)
Maturity: unknown
Exploit Reference (labs.watchtowr.com)
Maturity: unknown
Exploit Reference (isc.sans.edu)
Maturity: unknown
Exploit Reference (vicarius.io)
Maturity: unknown
Exploit Reference (vicarius.io)
Maturity: unknown
Exploit Reference (blog.talosintelligence.com)
Maturity: unknown
PHP CGI Module 8.3.4 - Remote Code Execution (RCE)
Maturity: poc
PHP CGI Argument Injection Remote Code Execution
exploit/windows/http/php_cgi_arg_injection_rce_cve_2024_4577
Maturity: weaponized
Weaknesses
CWE · root causeAffected systems
Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Alpine3 products
- php81< 8.1.29-r0
- php82< 8.2.20-r0
- php83< 8.3.8-r0
Chainguard2 products
- php-8.1< 8.1.29-r0
- php-8.2< 8.2.20-r0
Wolfi2 products
- php-8.1< 8.1.29-r0
- php-8.2< 8.2.20-r0
Fedoraproject1 product
- fedoraEOL39 | 40
Php1 product
- php≥ 8.1.0, < 8.1.29 | ≥ 8.2.0, < 8.2.20 | ≥ 8.3.0, < 8.3.8
Php group1 product
- php≥ 8.1.*, < 8.1.29 | ≥ 8.2.*, < 8.2.20 | ≥ 8.3.*, < 8.3.8
6 vendors · 10 products
References
27 links- devco.re/blog/2024/06/06/security-alert-cve-2024-4577-php-cgi-argument-injection-vulnerability-en/ARTICLEExploitThird Party Advisory
- www.imperva.com/blog/imperva-protects-against-critical-php-vulnerability-cve-2024-4577/ARTICLEThird Party Advisory
Show all 27 references
- www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2024-4577Government ResourceWEBUS Government Resource
- www.vicarius.io/vsociety/posts/php-cgi-os-command-injection-vulnerability-cve-2024-4577WEBExploitThird Party Advisory
- www.vicarius.io/vsociety/posts/php-cgi-argument-injection-to-rce-cve-2024-4577WEBExploitThird Party Advisory
- github.com/php/php-srcPACKAGE