High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    
High-profile threat    •    

CVE-2024-4577
PHP vulnerability analysis and mitigation

Summary

Researchers discovered a critical remote code execution vulnerability in PHP CGI, assigned CVE-2024-4577, affecting all Windows versions of PHP CGI. This vulnerability allows unauthenticated attackers to execute arbitrary code on remote servers via argument injection, bypassing previous protections. A patch was released on June 6, 2024, and users are strongly advised to update to the latest PHP versions or apply temporary mitigations. Wiz added a detection based on early details of the vulnerability, and will update it as new ones come to light.

Technical details

The vulnerability stems from the oversight of the Best-Fit feature in Windows’ encoding conversion while implementing PHP. This oversight enables attackers to bypass the protections of a previous vulnerability, CVE-2012-1823, using specific character sequences. The vulnerability affects PHP versions below 8.3.8, 8.2.20, and 8.1.29 on Windows operating systems. Attack scenarios include configurations running PHP under CGI mode or exposing the PHP binary, such as in XAMPP installations.

The vulnerability has been proven as exploitable on Windows systems using Traditional Chinese, Simplified Chinese, and Japanese locales. For other locales like English and Western European, comprehensive asset assessments and PHP updates are recommended due to the wide range of potential exploitation scenarios.

Affected products

The following versions of PHP are impacted by this vulnerability:

  • PHP 8.3 before version 8.3.8

  • PHP 8.2 before version 8.2.20

  • PHP 8.1 before version 8.1.29

PHP 8.0, PHP 7, and PHP 5 are End-of-Life, which are no longer maintained, and are also assumed to be vulnerable.

Remediation

Upgrade to the latest PHP versions (8.3.8, 8.2.20, 8.1.29). PHP 8.0, PHP 7, and PHP 5 are End-of-Life, and are no longer maintained anymore. It is recommended to upgrade to a newer branch or use the temporary recommendations in the Mitigation section.

Mitigation

For those unable to upgrade, apply the provided Rewrite Rules to block attacks. Note that these rules are only a temporary mitigation for Traditional Chinese, Simplified Chinese, and Japanese locales. It is still recommended to update to a patched version or migrate the architecture in practice.

Rewrite rules:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^%ad [NC]
RewriteRule .? - [F,L]

XAMPP users should disable the PHP CGI feature if not needed by commenting out the relevant lines in the Apache HTTP Server configuration.

# ScriptAlias /php-cgi/ “C:/xampp/php/”

References


SourceWiz Research

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

“Best User Experience I have ever seen, provides full visibility to cloud workloads.”
David EstlickCISO
“Wiz provides a single pane of glass to see what is going on in our cloud environments.”
Adam FletcherChief Security Officer
“We know that if Wiz identifies something as critical, it actually is.”
Greg PoniatowskiHead of Threat and Vulnerability Management