CVE-2024-4577
Argument Injection in PHP-CGI
Also known as EDB-52047, EDB-52331
Mitigation
- Upgrade PHP to 8.3.8 or later.
Who should check
- Anyone running PHP Group PHP >= 8.1.*, < 8.1.29; >= 8.2.*, < 8.2.20; >= 8.3.*, < 8.3.8
Vulnerability facts
- Affected
- PHP Group PHP >= 8.1.*, < 8.1.29; >= 8.2.*, < 8.2.20; >= 8.3.*, < 8.3.8
- Fixed in
- PHP Group PHP 8.1.29, PHP Group PHP 8.2.20, PHP Group PHP 8.3.8
- Exploited in the wild
- Yes: in CISA KEV since 2024-06-12; federal due date 2024-07-03; known ransomware use
- Public exploit / PoC
- Yes: see the exploit references below
- Remote exploitation
- Remote, no login needed
- CVSS
- 9.8 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: None
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- EPSS
- 94.81% chance of exploitation in 30 days (percentile 100, 2026-11-26)
- CWE
- CWE-78
- Modified
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| PHP Group PHP | >= 8.1.*, < 8.1.29; >= 8.2.*, < 8.2.20; >= 8.3.*, < 8.3.8 | — | cvelist |
Timeline
- 2024-06-09 Published
- 2024-06-12 Added to CISA KEV (exploited in the wild)
- 2024-07-03 CISA remediation due date for US federal agencies
- 2026-11-23 Last modified
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2024-4577. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2024-4577.md Affected: PHP Group PHP >= 8.1.*, < 8.1.29; >= 8.2.*, < 8.2.20; >= 8.3.*, < 8.3.8 Fixed in: PHP Group PHP 8.1.29, PHP Group PHP 8.2.20, PHP Group PHP 8.3.8 Steps: 1. Search this machine and project for PHP Group PHP: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Exploits and PoCs
- https://devco.re/blog/2024/06/06/security-alert-cve-2024-4577-php-cgi-argument-injection-vulnerability-en/
- https://arstechnica.com/security/2024/06/php-vulnerability-allows-attackers-to-run-malicious-code-on-windows-servers/
- https://github.com/11whoami99/CVE-2024-4577
- https://github.com/xcanwin/CVE-2024-4577-PHP-RCE
- https://labs.watchtowr.com/no-way-php-strikes-again-cve-2024-4577/
- https://github.com/watchtowrlabs/CVE-2024-4577
- https://isc.sans.edu/diary/30994
- https://www.vicarius.io/vsociety/posts/php-cgi-os-command-injection-vulnerability-cve-2024-4577
- https://www.vicarius.io/vsociety/posts/php-cgi-argument-injection-to-rce-cve-2024-4577
- https://blog.talosintelligence.com/new-persistent-attacks-japan/
- https://www.exploit-db.com/exploits/52047
- https://www.exploit-db.com/exploits/52331
Other
- https://blog.orange.tw/2024/06/cve-2024-4577-yet-another-php-rce.html
- https://www.imperva.com/blog/imperva-protects-against-critical-php-vulnerability-cve-2024-4577/
- https://www.php.net/ChangeLog-8.php#8.1.29
- https://www.php.net/ChangeLog-8.php#8.2.20
- https://www.php.net/ChangeLog-8.php#8.3.8
- https://cert.be/en/advisory/warning-php-remote-code-execution-patch-immediately
- http://www.openwall.com/lists/oss-security/2024/06/07/1
- 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
FAQ
Is CVE-2024-4577 being exploited?
Yes. CISA lists CVE-2024-4577 in its Known Exploited Vulnerabilities catalog since 2024-06-12, which means attacks have been seen. Public exploit code or a proof of concept is available. EPSS estimates a 94.81% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2024-4577?
Critical: CVSS 9.8 (v3.1, scored by CNA). Remote, no login needed.
Which versions are affected by CVE-2024-4577?
PHP Group PHP >= 8.1.*, < 8.1.29; >= 8.2.*, < 8.2.20; >= 8.3.*, < 8.3.8.
Is there a fix for CVE-2024-4577?
Yes. Fixed in PHP Group PHP 8.1.29, PHP Group PHP 8.2.20, PHP Group PHP 8.3.8. Upgrade PHP to 8.3.8 or later.
How do I check if I'm affected by CVE-2024-4577?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.