CVE-2024-4577
CriticalExploitedPublic exploitIn 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 Sep 8, 2026 · Also known as BIT-libphp-2024-4577, BIT-php-2024-4577, BIT-php-min-2024-4577, GHSA-3qgc-jrrr-25jv
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.
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
Exploited in the wild
Yes
4 catalog listings, used by ransomware
Public exploit code
Available
Proof-of-concept or weaponized module
Get the full CVE-2024-4577 brief as a PDF
Every affected product and fixed release, exploitation status and a first 24 hours response checklist, emailed within minutes.
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
66 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-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
php8-intl
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
Sep 8, 2026
Weakness Type
- CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
References
- advisoryhttps://blog.orange.tw/2024/06/cve-2024-4577-yet-another-php-rce.html
- advisoryhttps://cert.be/en/advisory/warning-php-remote-code-execution-patch-immediately
- advisoryhttps://github.com/CVEProject/cvelistV5/tree/main/cves/2024/4xxx/CVE-2024-4577.json
- advisoryhttps://security.netapp.com/advisory/ntap-20240621-0008/
- advisoryVulnCheck exploitation report
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 Running On Your Attack Surface?
Brandefense maps vulnerabilities like this one to your internet-facing assets and tells you exactly where to patch.
Request A Demo