Argument Injection in PHP-CGI
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA. Impact type from CWE-78.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Active
- Automatable
- Yes
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| PHP Group | PHP | before 8.1.29; before 8.2.20; before 8.3.8 | 8.1.29, 8.2.20, 8.3.8 | Patch available | CNA |
- PHP VendorPHP Group Affected before 8.1.29; before 8.2.20; before 8.3.8 Fixed in 8.1.29, 8.2.20, 8.3.8 Patch available CNA
CPE configurations NVD · 4
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:php:php:*:*:*:*:*:*:*:* | 8.1.0 to before 8.1.29; 8.2.0 to before 8.2.20; 8.3.0 to before 8.3.8 | Vulnerable | PHP |
| cpe:2.3:o:microsoft:windows:-:*:*:*:*:*:*:* | not specified by NVD | Running on | Microsoft |
| cpe:2.3:o:fedoraproject:fedora:39:*:*:*:*:*:*:* | 39 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:40:*:*:*:*:*:*:* | 40 | Vulnerable | Fedoraproject |
- cpe:2.3:a:php:php:*:*:*:*:*:*:*:* Versions 8.1.0 to before 8.1.29; 8.2.0 to before 8.2.20; 8.3.0 to before 8.3.8 Vulnerable ·PHP
- cpe:2.3:o:microsoft:windows:-:*:*:*:*:*:*:* Versions not specified by NVD Running on ·Microsoft
- cpe:2.3:o:fedoraproject:fedora:39:*:*:*:*:*:*:* Versions 39 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:40:*:*:*:*:*:*:* Versions 40 Vulnerable ·Fedoraproject
Remediation
- Fix · CNA PHP (PHP Group) Fixed in 8.1.29, 8.2.20, 8.3.8
Fixed in the same release
Records fixed by the same vendor advisory or release, as the CNA lists them.
- Release ·
PHP 8.1.29, 8.2.20, 8.3.8
4 records Highest priority Priority CRITICAL 1 CRITICAL, 1 HIGH, 2 MEDIUM
Other records, highest priority first
- TI-2024-05189 Command injection via array-ish $command parameter of proc_open() (bypass CVE-2024-1874 fix)Priority HIGH 73
- TI-2024-05072 Filter bypass in filter_var (FILTER_VALIDATE_URL)Priority MEDIUM 63
- TI-2024-02236 PHP is vulnerable to the Marvin AttackPriority MEDIUM 60
Vendor assessments
Red Hat
Red Hat rating: Critical. Red Hat's page for this CVE →
Not affected: 5 products
- Red Hat Enterprise Linux 10
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
Timeline
- 2024-06-12 Added to CISA KEV
- 2026-10-02 Threatist record created from CVE-2024-4577
- 2026-10-03 Alias added: GHSA-vxpp-6299-mxw3
References
Exploit 12
- https://github.com/php/php-src/security/advisories/GHSA-3qgc-jrrr-25jv
- 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://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://isc.sans.edu/diary/30994
- https://blog.talosintelligence.com/new-persistent-attacks-japan/
- https://www.vicarius.io/vsociety/posts/php-cgi-argument-injection-to-rce-cve-2024-4577
- https://www.vicarius.io/vsociety/posts/php-cgi-os-command-injection-vulnerability-cve-2024-4577
Advisory 5
- https://blog.orange.tw/2024/06/cve-2024-4577-yet-another-php-rce.html
- https://www.imperva.com/blog/imperva-protects-against-critical-php-vulnerability-cve-2024-4577/
- https://cert.be/en/advisory/warning-php-remote-code-execution-patch-immediately
- http://www.openwall.com/lists/oss-security/2024/06/07/1
- https://security.netapp.com/advisory/ntap-20240621-0008/
Other 5
- 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://lists.fedoraproject.org/archives/list/[email protected]/message/PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B/
- https://lists.fedoraproject.org/archives/list/[email protected]/message/W45DBOH56NQDRTOM2DN2LNA2FZIMC3PK/
More PHP Group vulnerabilities
- TI-2026-78794 PHP remote code execution via stale global state KEVCVSS 4.0CRITICAL 9.2
- TI-2026-78793 Out-of-memory handling flaw in PHP allows remote code execution KEVCVSS 4.0CRITICAL 9.2
- TI-2024-01743 Command injection via array-ish $command parameter of proc_open() CVSS 3.1CRITICAL 9.4
- TI-2022-13555 PDO::quote() may return unquoted string CVSS 3.1CRITICAL 9.1
- TI-2024-10408 Reference counting in php_request_shutdown causes Use-After-Free CVSS 4.0CRITICAL 9.2
- TI-2024-05189 Command injection via array-ish $command parameter of proc_open() (bypass CVE-2024-1874 fix) CVSS 3.1HIGH 8.8
Sources
- CVE-2024-4577 · CVE Program
- CVE-2024-4577 · NVD
- CISA Known Exploited Vulnerabilities
- FIRST EPSS
- GHSA-vxpp-6299-mxw3 · GitHub Advisory Database · CC BY 4.0
- CVE-2024-4577 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences