CVE-2024-4577
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.
Severity
CRITICAL
CVSS v3
9.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H · source cna
Exploit chance (EPSS)
99.987%
chance of exploitation in the next 30 days
among the highest of scored CVEs · 2026-11-17
CISA KEV
Listed
added 2024-06-12 · known ransomware use
Public exploit code
Yes
Exploit references (NVD and CNA): 12
Metasploit modules: 1
Nuclei templates: 1
Exploit-DB: 1
Weakness
- CWE-78: Improper Neutralization of Special Elements used in an OS Command
CISA Known Exploited Vulnerabilities entry
| Vulnerability name | PHP-CGI OS Command Injection Vulnerability |
|---|---|
| Vendor / product | PHP Group / PHP |
| Date added | 2024-06-12 |
| Federal remediation due date | 2024-07-03 |
| Required action | Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable. |
| Known ransomware campaign use | Known |
CISA SSVC decision points
| Exploitation | active |
|---|---|
| Automatable | yes |
| Technical impact | total |
| Scored | 2024-06-15 |
Timeline
- 2024-06-09Published by the CNA19:42 UTC
- 2024-06-12Added to the CISA KEV catalog3 days after publication
- 2024-06-15CISA SSVC decision recorded6 days after publication
- 2025-06-15First Exploit-DB entry (EDB-ID 52331)371 days after publication
Exploit and advisory records
| Exploit-DB | Type | Platform | Published | EDB-verified |
|---|---|---|---|---|
| EDB-ID 52331 | webapps | php | 2025-06-15 | no |
Nuclei templates:
- CVE-2024-4577: PHP CGI - Argument Injection
Affected products
Products listed as vulnerable. Upgrade to the version under "Fixed in", or a later one.
| Product | Vulnerable versions | Fixed in |
|---|---|---|
| php php | from 8.1.0 before 8.1.29fixed in 8.1.29from 8.2.0 before 8.2.20fixed in 8.2.20from 8.3.0 before 8.3.8fixed in 8.3.8 | 8.1.298.2.208.3.8 |
| fedoraproject fedora | 39no fix listed40no fix listed | not listednot listed |
References
- https://github.com/rapid7/metasploit-framework/pull/19247
- https://arstechnica.com/security/2024/06/php-vulnerability-allows-attackers-to-run-malicious-code-on-windows-servers/
- https://blog.talosintelligence.com/new-persistent-attacks-japan/
- https://devco.re/blog/2024/06/06/security-alert-cve-2024-4577-php-cgi-argument-injection-vulnerability-en/
- https://github.com/11whoami99/CVE-2024-4577
- https://github.com/php/php-src/security/advisories/GHSA-3qgc-jrrr-25jv
- https://github.com/watchtowrlabs/CVE-2024-4577
- https://github.com/xcanwin/CVE-2024-4577-PHP-RCE
- https://isc.sans.edu/diary/30994
- https://labs.watchtowr.com/no-way-php-strikes-again-cve-2024-4577/
- https://www.vicarius.io/vsociety/posts/php-cgi-argument-injection-to-rce-cve-2024-4577
- https://www.vicarius.io/vsociety/posts/php-cgi-os-command-injection-vulnerability-cve-2024-4577
- http://www.openwall.com/lists/oss-security/2024/06/07/1
- https://blog.orange.tw/2024/06/cve-2024-4577-yet-another-php-rce.html
- https://cert.be/en/advisory/warning-php-remote-code-execution-patch-immediately
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/W45DBOH56NQDRTOM2DN2LNA2FZIMC3PK/
- https://security.netapp.com/advisory/ntap-20240621-0008/
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2024-4577
- https://www.imperva.com/blog/imperva-protects-against-critical-php-vulnerability-cve-2024-4577/
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cve_lookup/CVE-2024-4577'curl 'https://api.contrastcyber.com/cve_risk_score/CVE-2024-4577'curl 'https://api.contrastcyber.com/cve_exploit/CVE-2024-4577'curl 'https://api.contrastcyber.com/cve_products/CVE-2024-4577'curl 'https://api.contrastcyber.com/kev_lookup/CVE-2024-4577'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- OWASP Top 10 categories by the OWASP Foundation (CC BY 3.0).
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).