CVE-2024-4577PHP 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.
Published Jun 7, 2024 · Updated Nov 5, 2026 · Also known as ALPINE-CVE-2024-4577, BIT-libphp-2024-4577, BIT-php-2024-4577, BIT-php-min-2024-4577, CGA-gmwp-fhmg-pqfm, CGA-p643-hjxc-p95c, CGA-v39m-ww8v-h7fq, CGA-x9h3-83w9-5jxh, ECHO-96a3-1302-f796, GHSA-3qgc-jrrr-25jv, GHSA-vxpp-6299-mxw3, openSUSE-SU-2024:14376-1
Key Facts
Patch immediately- CVE-2024-4577 is a critical-severity vulnerability (CVSS 9.8 v3.1) affecting PHP, Fedora (Fedoraproject), php81 (alpine) and 22 more products.
- It is exploited in the wild, listed in CISA KEV, Industry KEV feed, CIRCL KEV, ENISA EUVD since Jun 7, 2024 and is known to be used in ransomware campaigns. Public exploit code is available.
- EPSS estimates a 100% probability of exploitation in the next 30 days.
- Fixed versions are available, including libphp 8.1.29, libphp 8.2.20, libphp 8.3.8.
- Brandefense priority: patch immediately, because it is listed as exploited in the wild.
Scores
CVSS v3.1
9.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS (30-day exploit likelihood)
100%
Higher than 99.9% of all scored CVEs
Exploit maturity
Exploited (KEV)
ATLAS score
86/100
Publication score, see How it works
Exploitation Verdict
Exploit & Defence Guidance
Exploit maturity
Exploited (KEV)
Public exploit code
7
Proof-of-concept links
In-the-wild evidence
20
Reports of active use
Required action (CISA): Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.
Advisories And Exploit References
- advisoryhttps://blog.orange.tw/2024/06/cve-2024-4577-yet-another-php-rce.html
- advisoryhttps://www.cve.org/CVERecord?id=CVE-2024-4577
- advisoryhttps://security.alpinelinux.org/vuln/CVE-2024-4577
- advisoryVulnCheck exploitation report
- advisoryhttps://cert.be/en/advisory/warning-php-remote-code-execution-patch-immediately
- advisoryhttps://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/RM3WP4ENMVRYGM7IU7L7DTX3KTTN5UHE/
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.
Known-Exploited Catalog Listings
| Catalog | Added | Remediation due | Ransomware use |
|---|---|---|---|
| CISA KEV | Jun 12, 2024 | Jul 3, 2024 | Known |
| Industry KEV feed | Jun 7, 2024 | Jul 3, 2024 | Known |
| CIRCL KEV | Jun 7, 2024 | Jul 3, 2024 | Known |
| ENISA EUVD | Jun 12, 2024 | n/a | Not reported |
Required action: Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.
Affected Products
81 affected entries in total| Product | Affected versions | Fixed in |
|---|---|---|
| PHPPHP | >= 8.1.* | 8.1.29 |
| FedoraFedoraproject | 39, 40 | n/a |
| php81alpine | See advisory | 8.1.29-r0 |
| php82alpine | See advisory | 8.2.20-r0 |
| php83alpine | See advisory | 8.3.8-r0 |
Patched Releases
libphp
8.1.29, 8.2.20, 8.3.8
PHP
8.1.29, 8.1.29-1, 8.2.20, 8.3.8, 8.3.8-1
php-7.2
7.2.34+e1
php-8.1
8.1.29-r0
php-8.2
8.2.20-r0
php-min
8.1.29, 8.2.20, 8.3.8
php8
8.3.12-1.1
php8-bcmath
8.3.12-1.1
php8-bz2
8.3.12-1.1
php8-calendar
8.3.12-1.1
php8-cli
8.3.12-1.1
php8-ctype
8.3.12-1.1
php8-curl
8.3.12-1.1
php8-dba
8.3.12-1.1
php8-devel
8.3.12-1.1
php8-dom
8.3.12-1.1
php8-enchant
8.3.12-1.1
php8-exif
8.3.12-1.1
php8-ffi
8.3.12-1.1
php8-fileinfo
8.3.12-1.1
php8-ftp
8.3.12-1.1
php8-gd
8.3.12-1.1
php8-gettext
8.3.12-1.1
php8-gmp
8.3.12-1.1
php8-iconv
8.3.12-1.1
Timeline
Publicly disclosed
Jun 7, 2024
Added to Industry KEV feed
Jun 7, 2024
Added to CIRCL KEV
Jun 7, 2024
Added to CISA KEV
Jun 12, 2024
Added to ENISA EUVD
Jun 12, 2024
Last updated
Nov 5, 2026
Weakness Type
- CWE-20 Improper Input Validation
- CWE-78 Improper Neutralization of Special Elements used in an OS Command
References
- advisoryblog.orange.tw · CVE-2024-4577
- advisorycve.org · CVERecord
- advisorysecurity.alpinelinux.org · CVE-2024-4577
- advisoryVulnCheck exploitation report
- advisorycert.be · warning-php-remote-code-execution-patch-immedia…
FAQ
Common Questions.
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.
Affected: PHP versions >= 8.1.*; Fedora (Fedoraproject) versions 39, 40; php81 (alpine), among others. The full list is in the CVE brief.
It is exploited in the wild, listed in CISA KEV, Industry KEV feed, CIRCL KEV, ENISA EUVD since Jun 7, 2024 and is known to be used in ransomware campaigns.
Yes. It was added on Jun 12, 2024 with a federal remediation due date of Jul 3, 2024.
Public exploit code is available.
Fixed versions are available, including libphp 8.1.29, libphp 8.2.20, libphp 8.3.8.
Brandefense priority: patch immediately, because it is listed as exploited in the wild.
Is CVE-2024-4577 On Your Attack Surface?
Brandefense matches it against the products discovered on your perimeter and opens a finding the day a CVE like this is listed.
Request A Demo