Innovate faster and cut risk with PHP experts from Zend Services.
Explore Services
See How Zend Helps Leading Hosting Providers Keep Their Managed Sites on Secure PHP
Read More
Learn PHP from PHP experts with free, on-demand, and instructor led courses.
Explore Training
Submit support requests and browse self-service resources.
Explore Support
php: Argument Injection in PHP-CGI
When using Apache and PHP-CGI on Windows, if the system is set up to use certain code pages, Windows may use the "Best-Fit" behavior to replace characters in the command line given to Win32 API functions. The PHP CGI module may misinterpret those characters as PHP options that allow a malicious user to pass options to the PHP binary being run, revealing the source code of scripts or running arbitrary PHP code on the server.
We strongly recommend upgrading to a known patched version of PHP immediately.
If you cannot, you can mitigate this attack in a couple of ways:
apply a mod_rewrite rule to block attacks, like the following:
RewriteEngine On RewriteCond %{QUERY_STRING} ^%ad [NC] RewriteRule .? – [F,L]
If you use XAMPP and do not need the PHP CGI feature, find the 'ScriptAlias' directive in the Apache configuration file (typically at 'C:/xampp/apache/conf/extra/httpd-xampp.conf') and comment it out.
Admins can determine if they use PHP-CGI using the phpinfo() function and checking the 'Server API' value in the output.
It is suggested that system administrators consider migrating from CGI to more secure alternatives, like FastCGI, PHP-FPM, and Mod-PHP.
Direct link to CVE-2024-4577 >
< View all CVEs