home / blog
2026-11-25 · critical
CVE-2024-4577: Critical Vulnerability in PHP for Windows
Critical CVE-2024-4577 vulnerability in PHP for Windows with Apache and PHP-CGI.

CVE-2024-4577 affects PHP versions 8.1.*, 8.2.*, and 8.3.* before their respective patches on Windows systems with Apache and PHP-CGI. When the system uses certain code pages, Windows may use "Best-Fit" behavior to replace characters in the command line passed to Win32 API functions, allowing an attacker to interpret characters as PHP options, potentially executing arbitrary code or revealing script source code.
The vulnerability is classified as critical with a CVSS score of 9.8. It is officially documented in NVD since June 9, 2024, and affected versions are also confirmed by recent signals on developer platforms. Despite the time elapsed since publication, the vulnerability maintains its technical and security relevance.
For defense, it is essential to immediately apply patches by updating PHP to versions 8.1.29, 8.2.20, or 8.3.8 or later. For systems that cannot be immediately updated, consider disabling PHP-CGI if not strictly necessary or implementing additional input request controls. Monitor script execution anomalies and conduct periodic configuration checks.
At a glance
- What
- Vulnerability in PHP for Windows systems with Apache and PHP-CGI that allows attackers to pass options to PHP binary through manipulated characters.
- Severity
- Critical (CVSS 9.8)
- Affected versions
- PHP 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8
- Fix
- Update PHP to versions 8.1.29, 8.2.20 or 8.3.8 or later
- Status
- Vulnerability confirmed, patch available
- Action
- Apply patches to affected versions of PHP on Windows systems with Apache and PHP-CGI
Sources: NVD, CVE-2024-4577