# CVE-2024-4577: Argument Injection in PHP-CGI

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.8
- **CVSS:** 9.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Yes: in CISA KEV since 2024-06-12; federal due date 2024-07-03; known ransomware use
- **Public exploit / PoC:** Yes (see exploit references)
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 94.81% (percentile 100, 2026-11-26)
- **CWE:** CWE-78
- **Aliases:** EDB-52047, EDB-52331
- **Published:** 2024-06-09T19:42:36.464Z
- **Modified:** 2026-11-23T00:00:00.000Z

## Who should check

- Anyone running PHP Group PHP \>= 8.1.\*, \< 8.1.29; \>= 8.2.\*, \< 8.2.20; \>= 8.3.\*, \< 8.3.8

## 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.

## Affected and fixed versions

- PHP Group PHP: \>= 8.1.\*, \< 8.1.29; \>= 8.2.\*, \< 8.2.20; \>= 8.3.\*, \< 8.3.8 (cvelist)

## Mitigation

- Upgrade PHP to 8.3.8 or later.

## Timeline

- 2024-06-09: Published
- 2024-06-12: Added to CISA KEV (exploited in the wild)
- 2024-07-03: CISA remediation due date for US federal agencies
- 2026-11-23: Last modified

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-4577. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-4577.md
Affected: PHP Group PHP >= 8.1.*, < 8.1.29; >= 8.2.*, < 8.2.20; >= 8.3.*, < 8.3.8
Fixed in: PHP Group PHP 8.1.29, PHP Group PHP 8.2.20, PHP Group PHP 8.3.8

Steps:
1. Search this machine and project for PHP Group PHP: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-4577 being exploited?

Yes. CISA lists CVE-2024-4577 in its Known Exploited Vulnerabilities catalog since 2024-06-12, which means attacks have been seen. Public exploit code or a proof of concept is available. EPSS estimates a 94.81% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-4577?

Critical: CVSS 9.8 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2024-4577?

PHP Group PHP \>= 8.1.\*, \< 8.1.29; \>= 8.2.\*, \< 8.2.20; \>= 8.3.\*, \< 8.3.8.

### Is there a fix for CVE-2024-4577?

Yes. Fixed in PHP Group PHP 8.1.29, PHP Group PHP 8.2.20, PHP Group PHP 8.3.8. Upgrade PHP to 8.3.8 or later.

### How do I check if I'm affected by CVE-2024-4577?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

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

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-4577>
- Exploit-DB: Exploit metadata (ID and link only) from the Exploit Database <https://www.exploit-db.com/exploits/52047>
- CISA KEV: CISA Known Exploited Vulnerabilities Catalog <https://www.cisa.gov/known-exploited-vulnerabilities-catalog>

HTML: <https://flawdb.com/CVE-2024-4577> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-4577>
