Command Injection in PHP-CGI on Windows
CVE-2024-4577
Key Information:
- Vendor
PHP Group
- Status
- PHP
- CVE ID
- CVE ID:
- CVE-2024-4577
- Vendor
- CVE Published:
- 9 June 2024
- Fixed in
- Fixed in:
- 8.1.29, 8.2.20, 8.3.8
Timeline
Exploit known 2 days before it was disclosed
- 💰
Used in Ransomware
- 🦅
CISA Reported
- 🥇
Vulnerability reached the number 1 worldwide trending spot
- 📈
Vulnerability started trending
Vulnerability published
- 🟡
Public PoC available
- 👾
Exploit known to exist
- 📰
First article discovered by Heise Online
Vulnerability Reserved
Badges
How risky is it?
- Yes: Works over the network, no login needed
- Yes: Public exploit code (21 proof-of-concepts)
- Yes: Attacked in the wild (on CISA's KEV list)
- Yes: Used by ransomware
Our verdict
Patch now
Attackers are using it. Patch or mitigate today.
What to do
1Update to a fixed version
Several version ranges are affected; the full list is under Affected Version(s).
Install the PHP Windows release that fixes your version line, or later:
2Follow CISA's required action
Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.
3Can't patch yet? Reduce exposure
It can be reached over the network, so limit who can reach PHP Windows. Block it from the internet, allow only trusted hosts or a VPN, and turn off the affected feature if you don't use it, until you can update.
4Look for signs of compromise
It is being exploited in the wild, so check logs on exposed PHP Windows systems for unusual requests or new processes from before you patched. The 21 public proof-of-concepts show what an attack looks like.
5Why it's rated "Patch now"
- CISA lists it as a Known Exploited Vulnerability, so it is being attacked in the wild.
- Ransomware groups use it.
- Exploit code is public, so attacks are easy to copy.
- It can be exploited remotely without credentials.
- EPSS gives it a 99.9% chance of exploitation in the next 30 days.
- Its CVSS severity is critical (9.8).
What is CVE-2024-4577?
CVE-2024-4577 is a critical vulnerability in the PHP CGI module affecting Windows systems running Apache. The flaw occurs when certain code pages are used, causing the PHP CGI module to misinterpret command line arguments due to "Best-Fit" behavior in Windows. An attacker can exploit this vulnerability to pass arbitrary options to the PHP binary, potentially revealing source code and executing malicious PHP code on the server.
Affected PHP versions include 8.1.* before 8.1.29, 8.2.* before 8.2.20, and 8.3.* before 8.3.8. Exploitation has been observed in various regions, with attackers deploying remote access tools and cryptocurrency miners.
Potential Impact of CVE-2024-4577
-
Unauthorized code execution: Attackers can run arbitrary PHP code on the server, leading to full system compromise.
-
Deployment of malware: Exploitation can result in the installation of remote access trojans and cryptocurrency miners, allowing attackers to control the server and utilize its resources.
CISA has reported CVE-2024-4577
CISA provides regional cyber and physical services to support security and resilience across the United States. CISA monitor the most dangerous vulnerabilities and have identified CVE-2024-4577 as being exploited and is known by the CISA as enabling ransomware campaigns.
The CISA's recommendation is: Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.
Affected Version(s)
PHP Windows 8.1.*
PHP Windows 8.1.* < 8.1.29
PHP Windows 8.2.* < 8.2.20
Exploit Proof of Concept (PoC)
PoC code is written by security researchers to demonstrate the vulnerability can be exploited. PoC code is also a key component for weaponization which could lead to ransomware.
News Articles
Hackers Exploit Severe PHP Flaw to Deploy Quasar RAT and XMRig Miners
Hackers exploit PHP flaw (CVE-2024-4577) to deploy Quasar RAT and XMRig miners, with Taiwan hit hardest. Update PHP now to mitigate risks.
Critical 9.8 PHP flaw exploited in US, Japan and Singapore
Security pros say exploitation of critical PHP flaw could lead to system compromise and ransomware attacks.
Critical PHP RCE vulnerability mass exploited in new attacks
Threat intelligence company GreyNoise warns that a critical PHP remote code execution vulnerability that impacts Windows systems is now under mass exploitation.
References
More PHP Group Vulnerabilities
Request Smuggling in PHP-FPM
Use-After-Free Vulnerability in PHP Affects Multiple Versions and Releases
Remote Code Execution Vulnerability in PHP Session Management
Facts on this page come from the sources listed above; the writeup is AI-assisted. How we rate vulnerabilities · Report a correction
