Summary
generated automatically from NVD dataCVE-2024-4577 affects PHP 8.1, 8.2 and 8.3 when run through Apache and PHP-CGI on Windows with certain code pages configured. Windows "Best-Fit" character replacement in command lines can cause the PHP CGI module to misread characters as PHP options, letting an attacker pass options to the PHP binary (an OS command injection weakness, CWE-78). This can expose script source code or allow arbitrary PHP code execution on the server. It is rated CRITICAL (CVSS v3.1 9.8) and is listed in the CISA KEV catalog, with known use in ransomware campaigns.
NVD 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.
⚠️ Actively exploited — CISA KEV
This CVE was added to CISA's Known Exploited Vulnerabilities catalog on 2024-06-12. It is confirmed exploited in the wild and must be patched as a priority.
Remediation deadline (US federal agencies): 2024-07-03
Used in known ransomware campaigns.
EPSS · FIRST.org
94.8%probability of exploitation in the next 30 days
Higher than 99% of scored CVEs
EPSS (Exploit Prediction Scoring System) estimates, from observed exploitation activity, how likely a CVE is to be exploited in the next 30 days. It complements CVSS, which measures severity, not likelihood. Score of 2026-11-26, recomputed daily by FIRST.org.
In-depth analysis on cveo.tech
This CVE is covered in an article: context, affected versions and published fixes.
CVSS v3.1 Score
Information
- Published
- 9 juin 2024
- Updated
- 17 juin 2026
- Status
- Analyzed
- Source
- security@php.net
Affected products
Bounds published by NVD: "< 8.4.27" means 8.4.27 is no longer vulnerable. The fixed release to install is in the vendor advisory.
Weaknesses (CWE)
References (42)
- http://www.openwall.com/lists/oss-security/2024/06/07/1Mailing ListThird Party Advisory
- https://arstechnica.com/security/2024/06/php-vulnerability-allows-attackers-to-run-malicious-code-on-windows-servers/ExploitPress/Media CoverageThird Party Advisory
- https://blog.orange.tw/2024/06/cve-2024-4577-yet-another-php-rce.htmlThird Party Advisory
- https://cert.be/en/advisory/warning-php-remote-code-execution-patch-immediatelyThird Party Advisory
- https://devco.re/blog/2024/06/06/security-alert-cve-2024-4577-php-cgi-argument-injection-vulnerability-en/ExploitThird Party Advisory
- https://github.com/php/php-src/security/advisories/GHSA-3qgc-jrrr-25jvExploitThird Party Advisory
- https://github.com/rapid7/metasploit-framework/pull/19247ExploitIssue TrackingPatch
- https://github.com/watchtowrlabs/CVE-2024-4577ExploitThird Party Advisory
- https://github.com/xcanwin/CVE-2024-4577-PHP-RCEExploitThird Party Advisory
- https://isc.sans.edu/diary/30994ExploitThird Party Advisory
- https://labs.watchtowr.com/no-way-php-strikes-again-cve-2024-4577/ExploitThird Party Advisory
- https://security.netapp.com/advisory/ntap-20240621-0008/Third Party Advisory
- + 27 more references on NVD
Similar CVEs
Other vulnerabilities of type CWE-78
Running PHP servers? Know which CVEs hit your version.
Add the product and its version: cveo.tech lists the CVEs that affect it right away, then alerts you by email when a new one affects it — including before NVD has finished its analysis. Free, an account is all it takes.