---
title: "CVE-2024-4577: PHP-CGI OS Command Injection Vulnerability"
url: https://erroneo.us/security/cve/CVE-2024-4577/
description: "CVE-2024-4577 (PHP Group PHP): Exploited in the wild (CISA KEV). In PHP versions 8.1. before 8.1.29, 8.2. before 8.2.20, 8.3. before 8.3.8, when using…"
type: vulnerability-record
section: "Security Digest"
date_published: 2024-06-09
date_modified: 2026-10-21
publisher: erroneo.us
author: erroneo.us Security Desk
cve: "CVE-2024-4577"
kev: true
cvss: 9.8
epss: 0.99987
license: All rights reserved. Quote with attribution and a link.
---

# CVE-2024-4577: PHP-CGI OS Command Injection Vulnerability

**Signal:** Exploited: patch now if you run it. CISA has confirmed exploitation in the wild. (Computed from CISA KEV, EPSS and CVSS; not an editorial verdict.)

## Should you act?

- Yes, if you run PHP Group PHP. CISA added this CVE to its Known Exploited Vulnerabilities catalog on 2024-06-12, which means there is reliable evidence of exploitation in the wild. US federal agencies must remediate by 2024-07-03 ; treat that as the outer limit, not the target. CISA also lists it as known to be used in ransomware campaigns .
- EPSS 100.0% , percentile 100.0: FIRST’s model estimates a 100.0% chance of exploitation activity in the next 30 days, higher than 100.0% of all scored CVEs (very high). EPSS is a probability, not a verdict.
- Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
- Editorial verdict: Act now. CVE-2024-4577: PHP-CGI Argument Injection RCE on Windows — If you run PHP on Windows behind Apache in CGI mode (including any default XAMPP install), treat it as compromised-until-proven-otherwise and patch or remove CGI today; everyone else can relax.

## What it is

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 products (CVE record)

- PHP Group PHP: 8.1.* < 8.1.29, 8.2.* < 8.2.20, 8.3.* < 8.3.8

## Severity

- php CVSS 3.1: 9.8 `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## Exploitation

- CISA KEV: added 2024-06-12; federal due date 2024-07-03. Known ransomware use: Known.
- CISA required action: Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.
- CISA SSVC assessment: exploitation active , automatable yes , technical impact total .
- FIRST EPSS (model of 2026-10-21): 99.99% probability of exploitation activity in the next 30 days; percentile 100.0.

## Sources

- [Listed in CISA KEV notes (php.net)](https://www.php.net/ChangeLog-8.php#)
- [CVE.org record CVE-2024-4577](https://www.cve.org/CVERecord?id=CVE-2024-4577)
- [NVD entry CVE-2024-4577](https://nvd.nist.gov/vuln/detail/CVE-2024-4577)
- [CISA Known Exploited Vulnerabilities catalog entry](https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2024-4577)
- [github.com](https://github.com/php/php-src/security/advisories/GHSA-3qgc-jrrr-25jv)
- [blog.orange.tw](https://blog.orange.tw/2024/06/cve-2024-4577-yet-another-php-rce.html)
- [devco.re](https://devco.re/blog/2024/06/06/security-alert-cve-2024-4577-php-cgi-argument-injection-vulnerability-en/)
- [arstechnica.com](https://arstechnica.com/security/2024/06/php-vulnerability-allows-attackers-to-run-malicious-code-on-windows-servers/)
- [imperva.com](https://www.imperva.com/blog/imperva-protects-against-critical-php-vulnerability-cve-2024-4577/)
- [github.com](https://github.com/11whoami99/CVE-2024-4577)
- [github.com](https://github.com/xcanwin/CVE-2024-4577-PHP-RCE)
- [github.com](https://github.com/rapid7/metasploit-framework/pull/19247)
- [labs.watchtowr.com](https://labs.watchtowr.com/no-way-php-strikes-again-cve-2024-4577/)
- [github.com](https://github.com/watchtowrlabs/CVE-2024-4577)
- [php.net](https://www.php.net/ChangeLog-8.php#8.1.29)
- [php.net](https://www.php.net/ChangeLog-8.php#8.2.20)
- [php.net](https://www.php.net/ChangeLog-8.php#8.3.8)
- [cert.be](https://cert.be/en/advisory/warning-php-remote-code-execution-patch-immediately)
- [isc.sans.edu](https://isc.sans.edu/diary/30994)
- [openwall.com](http://www.openwall.com/lists/oss-security/2024/06/07/1)
- [lists.fedoraproject.org](https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B/)
- [lists.fedoraproject.org](https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/W45DBOH56NQDRTOM2DN2LNA2FZIMC3PK/)
- [security.netapp.com](https://security.netapp.com/advisory/ntap-20240621-0008/)
- [vicarius.io](https://www.vicarius.io/vsociety/posts/php-cgi-os-command-injection-vulnerability-cve-2024-4577)
- [vicarius.io](https://www.vicarius.io/vsociety/posts/php-cgi-argument-injection-to-rce-cve-2024-4577)
- [blog.talosintelligence.com](https://blog.talosintelligence.com/new-persistent-attacks-japan/)

---
Source page: https://erroneo.us/security/cve/CVE-2024-4577/ · Security Digest: https://erroneo.us/security/ · More: https://erroneo.us/llms.txt
