CVE-2024-4577: PHP-CGI OS Command Injection Vulnerability
CVE-2024-4577 is a critical-severity flaw (CVSS 9.8) affecting php, fedora, reported as exploited in the wild. Below: why it ranks where it does, which versions are affected, what to do, and the exact commands.
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 s
Why this priority
- Critical severity
- EPSS top 1%: very likely to be exploited
- Exploited in the wild (CISA KEV)
- Used in ransomware campaigns
- Public exploit reference
- Covered by 4 security sources
- CISA SSVC: automatable with total technical impact
- Remotely exploitable, no login, no user action
A fixed release or distro patch exists.
Risk facts
| CVSS score | 9.8 (Critical) |
| Attack vector | Network (remote) |
| Attack complexity | Low |
| Privileges needed | None |
| User interaction | None |
| EPSS exploit chance | 100.0% (top 1%) |
| CISA exploited list | Yes, fix due 2024-07-03, used in ransomware |
| Weakness | CWE-78 |
| Published | 2024-06-09 |
| Last modified | 2026-06-17 |
Last updated 2026-06-17 · Sources: CVE Program, NVD, CISA KEV, EPSS and vendor advisories · How we score
Am I affected?
Timeline
- Published CVE record published
- Exploited Added to the CISA Known Exploited Vulnerabilities list
- Deadline CISA due date for US federal agencies to patch
- Updated Record last modified
Exact fixes by distribution
Public exploits and detection
Public code exists for this CVE. Treat unpatched systems as at risk, and only run PoCs in a lab.
- GitHub PoC: watchtowrlabs/CVE-2024-4577 (324 stars)
- GitHub PoC: xcanwin/CVE-2024-4577-PHP-RCE (161 stars)
- GitHub PoC: TAM-K592/CVE-2024-4577 (75 stars)
- Write-up: arstechnica.com/security/2024/06/php-vulnerability-allows-attackers-to-run-malicious-code-
- Write-up: cert.be/en/advisory/warning-php-remote-code-execution-patch-immediately
- Exploit-DB: PHP < 8.3.8 - Unauthenticated Remote Code Execution (RCE) (Windows)
- Exploit-DB: PHP CGI Module 8.3.4 - Argument Injection / Remote Code Execution (RCE)
- Metasploit: PHP CGI Argument Injection Remote Code Execution
Advisories and coverage
Official advisories
- IPA Japan Security Alerts: PHPの脆弱性(CVE-2024-4577)を狙う攻撃について 2024-07-04
Research and news
- Vulners Bulletins: Exploit for OS Command Injection in Php 2026-11-01
- Vulners Bulletins: Exploit for Classic Buffer Overflow in Php 2026-10-31
- Tenable Research: php2shell (CVE-2026-109618, CVE-2026-109619): Frequently asked questions about critical PHP remote code execution vulnerabilities 2026-10-21
- GreyNoise Labs: GreyNoise Detects Mass Exploitation of Critical PHP-CGI Vulnerability (CVE-2024-4577), Signaling Broad Campaign 2025-03-07
Scores and fixes here are computed automatically from those and other public sources. Confirm with the vendor advisory before changing production systems.
Quick answers
How do I fix CVE-2024-4577?
php: upgrade to 8.1.29, 8.2.20, 8.3.8; fedora: mitigate or apply the listed mitigation. Exact commands for each OS are on this page.
Is CVE-2024-4577 being exploited?
Yes. CVE-2024-4577 is on the CISA Known Exploited Vulnerabilities list, so treat it as patch-now.
What does CVE-2024-4577 affect?
CVE-2024-4577 affects php, fedora. Severity is critical (CVSS 9.8). 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
How urgent is CVE-2024-4577?
Priority 100/100. Critical severity; EPSS top 1%: very likely to be exploited; Exploited in the wild (CISA KEV); Used in ransomware campaigns; Public exploit reference; Covered by 4 security sources; CISA SSVC: automatable with total technical impact; Remotely exploitable, no login, no user action
Software pages
PHP vulnerabilities · Windows vulnerabilities
Related CVEs
- CVE-2026-109619 HIGH 8.1 EXPLOITED UPGRADE MITIGATE PHP Stale Internal Request-State Vulnerability
- CVE-2026-109618 CRITICAL 9.8 EXPLOITED UPGRADE MITIGATE PHP Memory Corruption Vulnerability
- CVE-2026-91768 MEDIUM 6.5 UPGRADE The IPv6 branch of the FastCGI client access check compares only the first 12 bytes of a 16-byte IPv6 address,
- CVE-2026-92842 MEDIUM 5.9 UPGRADE The convert.base64-encode, convert.quoted-printable-encode and convert.quoted-printable-decode stream filters
- CVE-2026-91767 MEDIUM 6.5 UPGRADE php_openssl_matches_wildcard_name() in ext/openssl/xp_ssl.c underflows the length argument passed to memchr()