CVE-2024-4577 Details
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.
A critical remote code execution vulnerability has been identified in PHP versions 8.1.* prior to 8.1.29, 8.2.* prior to 8.2.20, and 8.3.* prior to 8.3.8. This vulnerability occurs when PHP is used in CGI mode on Windows, and certain code pages trigger 'Best-Fit' behavior in character encoding. Exploitation involves injecting command-line arguments that PHP misinterprets, allowing unauthorized execution of PHP code on the server. This vulnerability bypasses previous protections established for a similar issue in 2012.
Users are advised to upgrade to PHP versions 8.3.8, 8.2.20, or 8.1.29, where this vulnerability has been patched. For those using XAMPP on Windows, PHP CGI can be disabled by commenting out the ScriptAlias directive in the httpd-xampp.conf file. If an update is not possible, a temporary mitigation involves using Apache rewrite rules to block requests that contain the soft hyphen character.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Jun 15, 2024References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
This CVE is in CISA's Known Exploited Vulnerabilities Catalog
Reference CISA's BOD 22-01 and Known Exploited Vulnerabilities Catalog for further guidance and requirements.
| Vulnerability Name | Date Added | Due Date | Required Action |
|---|---|---|---|
| PHP-CGI OS Command Injection Vulnerability | Jun 12, 2024 | Jul 3, 2024 | Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable. |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | [email protected] |
| CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| php php | >= 8.1.0, < 8.1.29 >= 8.2.0, < 8.2.20 >= 8.3.0, < 8.3.8 |
CPE
Remediation
| |
| microsoft windows | All versions |
CPE
Remediation
| |
| fedoraproject fedora | 39 40 |
CPE
Remediation
| |
Change History
23 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Nov 3, 2025 | Modified Analysis | [email protected] |
| Oct 21, 2025 | CVE Modified | CISA-ADP |
| Oct 21, 2025 | CVE Modified | CISA-ADP |
| Oct 21, 2025 | CVE Modified | CISA-ADP |
| Mar 28, 2025 | Reanalysis | [email protected] |
| Mar 21, 2025 | Modified Analysis | [email protected] |
| Mar 14, 2025 | CVE Modified | CVE |
| Dec 20, 2024 | Modified Analysis | [email protected] |
| Nov 21, 2024 | CVE Modified | CVE |
| Aug 14, 2024 | Modified Analysis | [email protected] |
| Jun 21, 2024 | CVE Modified | [email protected] |
| Jun 21, 2024 | Modified Analysis | [email protected] |
| Jun 13, 2024 | CVE Modified | [email protected] |
| Jun 13, 2024 | CVE CISA KEV Update | Cybersecurity and Infrastructure Security Agency (CISA) U.S. Civilian Government |
| Jun 12, 2024 | CVE Modified | [email protected] |
| Jun 10, 2024 | CVE Modified | [email protected] |
| Jun 10, 2024 | CVE Modified | [email protected] |
| Jun 10, 2024 | Initial Analysis | [email protected] |
| Jun 10, 2024 | CVE Modified | [email protected] |
| Jun 10, 2024 | CVE Modified | [email protected] |
| Jun 9, 2024 | New CVE Received | [email protected] |