Back to Guides
Guide4 November 2026

What is CVE - 2024 - 4577 in PHP and How to Fix It on Windows

Decloak is an AI-powered web security intelligence platform that scans a site's HTTP/TLS posture, JavaScript, and third-party scripts to produce a report anyone can read. This guide is part of Decloak's library of practical, source-backed security guidance.

In this guide
  1. Key takeaways
  2. What exactly is CVE - 2024 - 4577?
  3. How does the vulnerability lead to remote code execution?
  4. Which PHP versions are vulnerable?
  5. What environments are most at risk?
  6. How to mitigate the issue immediately
  7. Verifying that the fix is in place
  8. What to do if you cannot upgrade immediately?
  9. Sources

Key takeaways

What exactly is CVE - 2024 - 4577?

CVE - 2024 - 4577 is a flaw in the way PHP (all supported Windows builds) converts Unicode characters to ASCII when running in CGI mode. The Windows "Best - Fit" mapping turns a soft - hyphen (U+00AD) into a regular hyphen, allowing an attacker to inject additional command - line arguments such as -d allow_url_include=1 into the PHP process.

How does the vulnerability lead to remote code execution?

When a request contains a soft - hyphen character in the query string, the CGI binary treats it as a normal hyphen after conversion. The injected argument is then passed to the PHP interpreter, which can enable dangerous settings or execute arbitrary code. This works even if the server is patched against the older PHP - CGI RCE bug (CVE - 2012 - 1823).

Which PHP versions are vulnerable?

PHP major versionVulnerable range
8.3< 8.3.8
8.2< 8.2.20
8.1< 8.1.29
8.0, 7.x, 5.xAll releases (no patches)

Only the three listed ranges receive official patches; older branches remain vulnerable with no fixes forthcoming.

What environments are most at risk?

The default configuration of XAMPP for Windows ships php-cgi.exe as a CGI handler, making XAMPP installations a common target. Any Windows server that exposes the PHP CGI binary to the web is at risk.

How to mitigate the issue immediately

  1. Upgrade PHP to a patched release (8.3.8, 8.2.20, 8.1.29 or later). This is the safest, long - term solution.
  2. Disable PHP CGI if you cannot upgrade: remove the ScriptAlias /php-cgi/ line from Apache’s configuration or ensure the CGI binaries are not reachable from the internet.
  3. Apply a temporary Apache rewrite rule that blocks requests containing the soft - hyphen (%ad) in the query string. Example:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^%ad [NC]
RewriteRule .? - [F,L]

This rule works for the three locales confirmed vulnerable: Traditional Chinese, Simplified Chinese, and Japanese.

Verifying that the fix is in place

What to do if you cannot upgrade immediately?

If you must keep an older PHP version for compatibility, combine steps 2 and 3: disable the CGI handler and add the rewrite rule. Monitor logs for any 403 responses to ensure the rule is catching malicious requests.

Sources

Free security scan

See what's actually exposed on your site.

Decloak's free scan runs in about 15 seconds, no account required, and covers:

  • HTTP/TLS security posture
  • JavaScript CVEs
  • Exposed Supabase/Lovable/Base44 misconfigurations
  • AI-written executive summary