CVE Tools

CVE-2024-4577

Argument Injection in PHP-CGI

Published: Jun 9, 2024Updated: Nov 3, 2025 Sources: CVE List NVD BDUCWE-78

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.

In plain language

AI Act now

CVE-2024-4577 is a Windows-only PHP-CGI bug that lets an attacker take over a PHP web server or view hidden files with just network requests, and small businesses should treat it as urgent if you run PHP-CGI on Windows with Apache.

Executive summary

Unauthenticated remote attackers can exploit Windows text conversion (“Best-Fit” character mapping) when using Apache with PHP-CGI on Windows under specific non-UTF-8 locale/code page settings, causing PHP-CGI to misinterpret crafted characters as PHP options and enabling code execution and/or disclosure of server scripts; this is listed in CISA KEV and used in ransomware campaigns.

If affected, business impact
Full web application takeoverHidden server files exposedArbitrary code executionRansomware risk

What to do now

  1. Check whether you run PHP-CGI on Windows with Apache (not just generic PHP-FPM) and whether your server’s locale/code pages use non-UTF-8 settings.
  2. Verify your PHP version and whether it is within the vulnerable ranges: 8.1 (before 8.1.29), 8.2 (before 8.2.20), or 8.3 (before 8.3.8).
  3. Upgrade PHP to one of the fixed versions: 8.1.29, 8.2.20, or 8.3.8 (or newer in the same branches).
  4. If you cannot upgrade immediately, disable or discontinue using PHP-CGI on Apache on the affected Windows setup and follow your vendor’s mitigation guidance until you can patch.
Patch / advisory Usually a quick update

CVSS Vector Breakdown

AV:NAC:LPR:NUI:NS:UC:HI:HA:H
Exploitability
AV:NAttack Vector
Network
AC:LAttack Complexity
Low
PR:NPrivileges Required
None
UI:NUser Interaction
None
Scope
S:UScope
Unchanged
Impact
C:HConfidentiality
High
I:HIntegrity
High
A:HAvailability
High

Weaknesses

Affected Products

php
oss-project·USaka pear, php language, pecl
fedoraproject
oss-project·USaka fedora project
PHP Group
oss-projectaka php, pear
PHPLibraryLibrary
OSS Libraries
Microsoft Corp
commercial·USaka microsoft corporation

Exploitability

CISA Known Exploited Vulnerability
Added to KEV:Jun 12, 2024
Remediation due:Jul 3, 2024
Ransomware:Known ransomware use

Required action: Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.

12 exploit sources identified

Exploit details including PoC links, Metasploit modules, and scanner templates are available after registration.

View exploit details
Official Patch Available

Attack Graph

Products CVE Techniques Tactics

Click technique nodes for MITRE ATT&CK details · drag to pan · Ctrl/ + scroll to zoom, or go fullscreen.

MITRE ATT&CK

1 technique
Execution
View detailed technique mapping

References

and 24 more references View all →
3

Unlock Complete Vulnerability Intelligence

Get the full picture for CVE-2024-4577 and every CVE in our database. Create a free account — no credit card required.

Create Free Account
Plain-language analysis
Impact assessment and exploitation scenario in plain English
Attack graph visualization
Interactive attack path and kill chain mapping
Exploit details & PoC links
ExploitDB, Metasploit, GitHub PoCs with direct links
Nuclei scanner templates
Ready-to-use vulnerability scanner templates
Full remediation guide
Patch instructions, workarounds, and compliance impact
Interactive AI chat
Ask questions about this vulnerability in natural language
Related vulnerabilities
Semantically similar CVEs and attack patterns
REST API & MCP access
Integrate vulnerability data into your workflows