CVE Tools

CVE-2024-4577

Argument Injection in PHP-CGI

Exploited in the wild. In CISA KEV since 2024‑06‑12. A vendor fix is available.

Published Updated Sources: CVE.org, NVD, BDU

What to do

The vendor has published a fix. Version details are below where the sources state them.

Steps

Written by AI from the record
  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.

What it is

From the CVE record

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

Written by AI from the record

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.

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 you're affected

  • Full web application takeover
  • Hidden server files exposed
  • Arbitrary code execution
  • Ransomware risk

Exploitation

Where each signal puts this CVE on the scale from published to confirmed exploited.

EPSS99th
Public exploit
CISA KEV
CISA KEV

Listed as exploited in the wild since 2024-06-12.

US federal agencies must remediate by 2024-07-03.

Known use in ransomware campaigns.

Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.
Public exploits

12 sources with a proof of concept or module.

Exploit links, PoCs and Metasploit modules after sign-in
EPSS

100% chance of exploitation activity in the next 30 days, which ranks it in the 99th percentile of scored CVEs.

Exploit Prediction Scoring System, FIRST.org. A probability, not a confirmation.

Lifecycle

The patch came 123 days before any public exploit.

  1. OpenVAS check added
  2. Public exploit / PoCsource: github-poc
  3. Nuclei check added
  4. Patch availablerecord updated
  5. Added to CISA KEVransomware campaign
  6. Publishedweakness classified, att&ck mapped

Affected products

Technical detail

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Scored 9.8 by NVD.

How it is reached

  • Attack Vector NetworkExploitable remotely over the network without any special conditions
  • Attack Complexity LowNo special conditions — the attack can be reliably reproduced
  • Privileges Required NoneNo authentication required — anyone can exploit this
  • User Interaction NoneNo user interaction needed — fully automated exploitation

Scope

  • Scope UnchangedImpact is limited to the vulnerable component itself

Impact if exploited

  • Confidentiality HighTotal information disclosure — all data in the component is compromised
  • Integrity HighTotal loss of integrity — attacker can modify any data in the component
  • Availability HighTotal denial of service — the component is completely unavailable

Weaknesses

ATT&CK techniques

Mapped from the weaknesses above (CWE to ATT&CK), not observed in attacks.

Sources

Watch the software you run.

My Stack ranks new CVEs for your products by real-world exploitation, so the next exploited one reaches you without reading every advisory.

We'll flag the next CVE, public exploit or patch for Php, not every advisory. This one: actively exploited.

We use analytics cookies to see which pages and articles actually help people. Decline and none of them run — the site works the same. What we store