CVE-2024-4577
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.
Summary dbcve.org
PHP-CGI on Windows with Apache is vulnerable to argument injection via Windows' Best-Fit character mapping. When certain code pages are configured, character replacements in command-line arguments passed to Win32 API functions can be interpreted as PHP options (e.g., -d flags), enabling source code disclosure or arbitrary code execution.
Mitigation
Upgrade PHP to 8.1.29+, 8.2.20+, or 8.3.8+; alternatively, switch from PHP-CGI to mod_php to eliminate the CGI attack surface.