CVE-2024-4577: PHP-CGI OS Command Injection
PHP Group PHP · listed in the CISA catalog of actively exploited vulnerabilities since 2024-06-12.
- CVSS v3.1 (CVE record)
- 9.8
- critical
- EPSS (exploit probability, 30 days)
- >99.9%
- among the highest 0.1% of all CVEs
- Added to CISA KEV
- 2024-06-12
- US federal due date 2024-07-03
- Automatable (CISA SSVC)
- yes
- technical impact: total
What is CVE-2024-4577?
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 required action: Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.
CISA notes
- This vulnerability affects a common open-source component, third-party library, or a protocol used by different products. Please check with specific vendors for information on patching status. For more information, please see: php.net/ChangeLog-8.php; nvd.nist.gov/vuln/detail/CVE-2024-4577
Affected and fixed versions
From the CVE record published by the vendor or CVE numbering authority.
- PHP Group PHPWindows, CGIAffectedFixed in
- 8.1.*, < 8.1.29
- 8.2.*, < 8.2.20
- 8.3.*, < 8.3.8
not stated
| Product | Affected | Fixed in |
|---|---|---|
| PHP Group PHPWindows, CGI |
| not stated |
How to fix it
- The CVE record names no fixed version – check the vendor advisory and CISA's required action for updates and mitigations.
- Vendor advisory: github.com/php/php-src/security/advisories/GHSA-3qgc-jrrr…
- CISA's deadline for US federal agencies: 2024-07-03 (passed) – a useful benchmark for everyone else, too.
CISA's assessment (SSVC)
- Exploitation
- Exploited in the wild
- Automatable
- Yes – attackers can automate it at scale
- Technical impact
- Total – full control of the component or total information disclosure
Weakness: CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
References
Other advisories
Trackers and catalogs
Data: CISA Known Exploited Vulnerabilities (public domain) · CVE Program records incl. CISA ADP enrichment · OSV.dev (CC BY 4.0) incl. Ubuntu and Debian security data · FIRST EPSS · endoflife.date. Updated automatically – facts last changed 2026-11-21. Always confirm with the vendor's or distribution's advisory before patching.