CVE-2024-4577: PHP-CGI OS Command Injection Vulnerability
Reference page built from the source records below, each shown as its source publishes it. Dataset version ref-050a1c877f30, updated 2026-11-02T23:39:54.475Z.
CISA Known Exploited Vulnerabilities
- Name
- PHP-CGI OS Command Injection Vulnerability
- Vendor
- PHP Group
- Product
- PHP
- Added to the catalog
- 2024-06-12
- Due date for US federal agencies
- 2024-07-03
- Weaknesses
- CWE-78
- Catalog version
- 2026.10.30
PHP, specifically Windows-based PHP used in CGI mode, contains an OS command injection vulnerability that allows for arbitrary code execution. This vulnerability is a patch bypass for CVE-2012-1823.
Required action (CISA)
Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.
Ransomware use: CISA marks this vulnerability as known to be used in ransomware campaigns. CISA does not say which group used it.
Links in CISA's notes
Read on 2026-11-02T23:39:54.475Z under licence cisa-kev-cc0@b0067899 from https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json
NVD analysis
- Status
- Analyzed
- Published
- 2024-06-09T20:15:09.550
- Last modified
- 2026-06-17T08:02:11.493
- Weaknesses
- CWE-78
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.
| Metric | Score | Severity | Vector | Scored by |
|---|---|---|---|---|
| CVSS 3.1 | 9.8 | CRITICAL | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | [email protected] (Secondary) |
| CVSS 3.1 | 9.8 | CRITICAL | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | [email protected] (Primary) |
References
- http://www.openwall.com/lists/oss-security/2024/06/07/1 (Mailing List, Third Party Advisory)
- https://arstechnica.com/security/2024/06/php-vulnerability-allows-attackers-to-run-malicious-code-on-windows-servers/ (Exploit, Press/Media Coverage, Third Party Advisory)
- https://blog.orange.tw/2024/06/cve-2024-4577-yet-another-php-rce.html (Third Party Advisory)
- https://cert.be/en/advisory/warning-php-remote-code-execution-patch-immediately (Third Party Advisory)
- https://devco.re/blog/2024/06/06/security-alert-cve-2024-4577-php-cgi-argument-injection-vulnerability-en/ (Exploit, Third Party Advisory)
- https://github.com/11whoami99/CVE-2024-4577 (Exploit)
- https://github.com/php/php-src/security/advisories/GHSA-3qgc-jrrr-25jv (Exploit, Third Party Advisory)
- https://github.com/rapid7/metasploit-framework/pull/19247 (Exploit, Issue Tracking, Patch)
- https://github.com/watchtowrlabs/CVE-2024-4577 (Exploit, Third Party Advisory)
- https://github.com/xcanwin/CVE-2024-4577-PHP-RCE (Exploit, Third Party Advisory)
- https://isc.sans.edu/diary/30994 (Exploit, Third Party Advisory)
- https://labs.watchtowr.com/no-way-php-strikes-again-cve-2024-4577/ (Exploit, Third Party Advisory)
- https://lists.fedoraproject.org/archives/list/[email protected]/message/PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B/ (Mailing List)
- https://lists.fedoraproject.org/archives/list/[email protected]/message/W45DBOH56NQDRTOM2DN2LNA2FZIMC3PK/ (Mailing List)
- https://security.netapp.com/advisory/ntap-20240621-0008/ (Third Party Advisory)
- https://www.imperva.com/blog/imperva-protects-against-critical-php-vulnerability-cve-2024-4577/ (Third Party Advisory)
- https://www.php.net/ChangeLog-8.php#8.1.29 (Release Notes)
- https://www.php.net/ChangeLog-8.php#8.2.20 (Release Notes)
- https://www.php.net/ChangeLog-8.php#8.3.8 (Release Notes)
- http://www.openwall.com/lists/oss-security/2024/06/07/1 (Mailing List, Third Party Advisory)
- https://arstechnica.com/security/2024/06/php-vulnerability-allows-attackers-to-run-malicious-code-on-windows-servers/ (Exploit, Press/Media Coverage, Third Party Advisory)
- https://blog.orange.tw/2024/06/cve-2024-4577-yet-another-php-rce.html (Third Party Advisory)
- https://blog.talosintelligence.com/new-persistent-attacks-japan/ (Exploit, Third Party Advisory)
- https://cert.be/en/advisory/warning-php-remote-code-execution-patch-immediately (Third Party Advisory)
- https://devco.re/blog/2024/06/06/security-alert-cve-2024-4577-php-cgi-argument-injection-vulnerability-en/ (Exploit, Third Party Advisory)
- https://github.com/11whoami99/CVE-2024-4577 (Exploit)
- https://github.com/php/php-src/security/advisories/GHSA-3qgc-jrrr-25jv (Exploit, Third Party Advisory)
- https://github.com/rapid7/metasploit-framework/pull/19247 (Exploit, Issue Tracking, Patch)
- https://github.com/watchtowrlabs/CVE-2024-4577 (Exploit, Third Party Advisory)
- https://github.com/xcanwin/CVE-2024-4577-PHP-RCE (Exploit, Third Party Advisory)
- https://isc.sans.edu/diary/30994 (Exploit, Third Party Advisory)
- https://labs.watchtowr.com/no-way-php-strikes-again-cve-2024-4577/ (Exploit, Third Party Advisory)
- https://lists.fedoraproject.org/archives/list/[email protected]/message/PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B/ (Mailing List)
- https://lists.fedoraproject.org/archives/list/[email protected]/message/W45DBOH56NQDRTOM2DN2LNA2FZIMC3PK/ (Mailing List)
- https://security.netapp.com/advisory/ntap-20240621-0008/ (Third Party Advisory)
- https://www.imperva.com/blog/imperva-protects-against-critical-php-vulnerability-cve-2024-4577/ (Third Party Advisory)
- https://www.php.net/ChangeLog-8.php#8.1.29 (Release Notes)
- https://www.php.net/ChangeLog-8.php#8.2.20 (Release Notes)
- https://www.php.net/ChangeLog-8.php#8.3.8 (Release Notes)
- https://www.vicarius.io/vsociety/posts/php-cgi-argument-injection-to-rce-cve-2024-4577 (Exploit, Third Party Advisory)
- https://www.vicarius.io/vsociety/posts/php-cgi-os-command-injection-vulnerability-cve-2024-4577 (Exploit, Third Party Advisory)
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2024-4577 (US Government Resource)
This product uses the NVD API but is not endorsed or certified by the NVD.
Read on 2026-11-02T23:42:15.686Z under licence nvd-api-terms-of-use@ff2a5288 from https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2024-4577
CVE record
- Title (CNA)
- Argument Injection in PHP-CGI
- Assigner
- php
- State
- PUBLISHED
- Published
- 2024-06-09T19:42:36.464Z
- Updated
- 2025-10-21T23:05:16.089Z
- Problem types
- CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
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.
References
- https://github.com/php/php-src/security/advisories/GHSA-3qgc-jrrr-25jv
- https://blog.orange.tw/2024/06/cve-2024-4577-yet-another-php-rce.html
- https://devco.re/blog/2024/06/06/security-alert-cve-2024-4577-php-cgi-argument-injection-vulnerability-en/
- https://arstechnica.com/security/2024/06/php-vulnerability-allows-attackers-to-run-malicious-code-on-windows-servers/
- https://www.imperva.com/blog/imperva-protects-against-critical-php-vulnerability-cve-2024-4577/
- https://github.com/11whoami99/CVE-2024-4577
- https://github.com/xcanwin/CVE-2024-4577-PHP-RCE
- https://github.com/rapid7/metasploit-framework/pull/19247
- https://labs.watchtowr.com/no-way-php-strikes-again-cve-2024-4577/
- https://github.com/watchtowrlabs/CVE-2024-4577
- https://www.php.net/ChangeLog-8.php#8.1.29
- https://www.php.net/ChangeLog-8.php#8.2.20
- https://www.php.net/ChangeLog-8.php#8.3.8
- https://cert.be/en/advisory/warning-php-remote-code-execution-patch-immediately
- https://isc.sans.edu/diary/30994
- http://www.openwall.com/lists/oss-security/2024/06/07/1
- https://lists.fedoraproject.org/archives/list/[email protected]/message/PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B/
- https://lists.fedoraproject.org/archives/list/[email protected]/message/W45DBOH56NQDRTOM2DN2LNA2FZIMC3PK/
- https://security.netapp.com/advisory/ntap-20240621-0008/
Read on 2026-11-03T02:13:33.770Z under licence cve-terms-of-use@81bfa2f3 from https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2024/4xxx/CVE-2024-4577.json
Defensive techniques (MITRE D3FEND)
D3FEND maps these defensive techniques to the weakness (CWE) that NVD lists for this CVE, through the digital artifacts the weakness affects. D3FEND does not say they stop this vulnerability.
CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
- Model: Asset Vulnerability Enumeration (acts on Software)
- Harden: Software Update (acts on Software)
- Restore: Restore Software (acts on Software)
- Harden: Domain Logic Validation (acts on Subroutine)
- Harden: Variable Initialization (acts on Subroutine)
- Harden: Credential Scrubbing (acts on Subroutine)
- Harden: Trusted Library (acts on Subroutine)
- Isolate: Application-based Process Isolation (acts on Subroutine)
- Model: Software Inventory (acts on Software)
D3FEND ontology version 1.6.0.
Read on 2026-11-02T23:54:16.526Z under licence d3fend-terms-of-use@f98cbc7e from https://d3fend.mitre.org/api/weakness/cwe/CWE-78.json
MITRE D3FEND™ knowledge graph. © 2025 The MITRE Corporation.
"The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use D3FEND for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE's copyright designation and this license in any such copy." Terms: https://d3fend.mitre.org/tou/
Sources and licences
CISA
Source: CISA Catalog of Known Exploited Vulnerabilities, version 2026.10.30, CC0 1.0. Use of this data does not imply endorsement by CISA or DHS.
National Vulnerability Database (NIST)
This product uses the NVD API but is not endorsed or certified by the NVD.
NVD API Terms of Use (NIST publications in the public domain, 17 U.S.C. 105)
CVE Program, The MITRE Corporation
Copyright © 1999-2026, The MITRE Corporation. CVE is a trademark and the CVE logo is a registered trademark of The MITRE Corporation. CVE Usage: MITRE hereby grants you a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Common Vulnerabilities and Exposures (CVE™). Any copy you make for such purposes is authorized provided that you reproduce MITRE's copyright designation and this license in any such copy.
MITRE D3FEND
MITRE D3FEND™ knowledge graph. © 2025 The MITRE Corporation.
"The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use D3FEND for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE's copyright designation and this license in any such copy." Terms: https://d3fend.mitre.org/tou/MITRE D3FEND Terms of Use (site + knowledge graph); source repo MIT
Cite this page
Dragons Eye Ransomware Tracker, "CVE-2024-4577: PHP-CGI OS Command Injection Vulnerability",
entity page, dataset version ref-050a1c877f30, updated 2026-11-02T23:39:54.475Z,
https://ransomware-tracker.com/cve/CVE-2024-4577 (accessed 2026-11-03).
Underlying source: CISA Catalog of Known Exploited Vulnerabilities, version 2026.10.30.
Underlying source: National Vulnerability Database (NIST), CVE API 2.0, record last modified 2026-06-17T08:02:11.493.
Underlying source: CVE List (CVE Program, The MITRE Corporation), record updated 2025-10-21T23:05:16.089Z.
Underlying source: MITRE D3FEND, ontology version 1.6.0.
Pages change. The dataset version identifies the data, but no archive of old versions is kept, so this citation cannot be replayed later.