CVE-2024-4577
Argument Injection in PHP-CGI
Exploited in the wild. In CISA KEV since 2024‑06‑12. A vendor fix is available.
What to do
The vendor has published a fix. Version details are below where the sources state them.
Steps
Written by AI from the record- Check whether you run PHP-CGI on Windows with Apache (not just generic PHP-FPM) and whether your server’s locale/code pages use non-UTF-8 settings.
- Verify your PHP version and whether it is within the vulnerable ranges: 8.1 (before 8.1.29), 8.2 (before 8.2.20), or 8.3 (before 8.3.8).
- Upgrade PHP to one of the fixed versions: 8.1.29, 8.2.20, or 8.3.8 (or newer in the same branches).
- If you cannot upgrade immediately, disable or discontinue using PHP-CGI on Apache on the affected Windows setup and follow your vendor’s mitigation guidance until you can patch.
What it is
From the CVE record
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.
In plain language
Written by AI from the recordCVE-2024-4577 is a Windows-only PHP-CGI bug that lets an attacker take over a PHP web server or view hidden files with just network requests, and small businesses should treat it as urgent if you run PHP-CGI on Windows with Apache.
Unauthenticated remote attackers can exploit Windows text conversion (“Best-Fit” character mapping) when using Apache with PHP-CGI on Windows under specific non-UTF-8 locale/code page settings, causing PHP-CGI to misinterpret crafted characters as PHP options and enabling code execution and/or disclosure of server scripts; this is listed in CISA KEV and used in ransomware campaigns.
If you're affected
- Full web application takeover
- Hidden server files exposed
- Arbitrary code execution
- Ransomware risk
Exploitation
Where each signal puts this CVE on the scale from published to confirmed exploited.
- CISA KEV
Listed as exploited in the wild since 2024-06-12.
US federal agencies must remediate by 2024-07-03.
Known use in ransomware campaigns.
Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.
- Public exploits
12 sources with a proof of concept or module.
Exploit links, PoCs and Metasploit modules after sign-in- EPSS
100% chance of exploitation activity in the next 30 days, which ranks it in the 99th percentile of scored CVEs.
Exploit Prediction Scoring System, FIRST.org. A probability, not a confirmation.
Lifecycle
The patch came 123 days before any public exploit.
- OpenVAS check added
- Public exploit / PoCsource: github-poc
- Nuclei check added
- Patch availablerecord updated
- Added to CISA KEVransomware campaign
- Publishedweakness classified, att&ck mapped
Affected products
Technical detail
CVSS 3.1 vector
Open in the CVSS calculatorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Scored 9.8 by NVD.
How it is reached
- Attack Vector NetworkExploitable remotely over the network without any special conditions
- Attack Complexity LowNo special conditions — the attack can be reliably reproduced
- Privileges Required NoneNo authentication required — anyone can exploit this
- User Interaction NoneNo user interaction needed — fully automated exploitation
Scope
- Scope UnchangedImpact is limited to the vulnerable component itself
Impact if exploited
- Confidentiality HighTotal information disclosure — all data in the component is compromised
- Integrity HighTotal loss of integrity — attacker can modify any data in the component
- Availability HighTotal denial of service — the component is completely unavailable
Weaknesses
ATT&CK techniques
Mapped from the weaknesses above (CWE to ATT&CK), not observed in attacks.
Sources
References in the record
- openwall.com/lists/oss-security/2024/06/07/1
- arstechnica.com/security/2024/06/php-vulnerability-allows-attackers-to-run-malicious-code-on-windows-servers/
- blog.orange.tw/2024/06/cve-2024-4577-yet-another-php-rce.html
And 24 more references. See all after sign-in
In the news
Watch the software you run.
My Stack ranks new CVEs for your products by real-world exploitation, so the next exploited one reaches you without reading every advisory.
We'll flag the next CVE, public exploit or patch for Php, not every advisory. This one: actively exploited.
A free account adds
- The full version matrix and every affected product
- Exploit links, proofs of concept and Metasploit modules
- Email alerts for the products you watch
- The same data over REST API, MCP and CLI