Live threats

All CVEs / PHP Group

CVE-2024-4577PHP Group PHP

OS Command Injection in PHP-CGI on Windows

Critical 9.8 KEVRansomware No auth neededHigh EPSS

Priority
98
CVSS 3.1
9.8
EPSS
94.8%
probability of exploitation in 30 days · percentile 100
Auth required
No
In KEV since
Jun 12, 2024
CISA deadline
Jul 3, 2024
Ransomware use
Confirmed
Published
Jun 9, 2024
Updated
Jun 17, 2026
Category
Web application · Cross-platform
Weakness (CWE)
CWE-78
SSVC (CISA)
Exploitation: active · Automatable: yes · Technical impact: total
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

What happens

PHP versions 8.1 (before 8.1.29), 8.2 (before 8.2.20), and 8.3 (before 8.3.8) on Windows with Apache and PHP-CGI are vulnerable to OS command injection. An unauthenticated attacker can exploit Windows "Best-Fit" code page behavior to pass malicious options to the PHP binary, allowing source code disclosure or arbitrary PHP code execution. CISA confirmed this vulnerability as actively exploited.

Show the original NVD text

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.

Source text, unmodified. NVD.

Exploitation confirmed by CISA

PHP, specifically Windows-based PHP used in CGI mode, contains an OS command injection vulnerability that allows for arbitrary code execution. This vulnerability is a patch bypass for CVE-2012-1823.

Action required by CISA: Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.

Source text, unmodified. CISA KEV.

What to do

Patch available · fixed versions: 8.1.29, 8.2.20, 8.3.8

Update PHP to version 8.1.29, 8.2.20, 8.3.8 or later depending on your version branch. If you use PHP-CGI on Windows with Apache, apply the update immediately.

Vendor advisory · www.php.net ↗

  1. Apply the vendor's security update for PHP.
  2. CISA has confirmed it is exploited: treat it as urgent. The deadline for US federal agencies was July 3, 2024.
  3. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
  4. Check logs for signs of earlier exploitation.

Affected products (CPE)

VendorProductVersions
phpphp≥ 8.1.0 < 8.1.29
phpphp≥ 8.2.0 < 8.2.20
phpphp≥ 8.3.0 < 8.3.8
fedoraprojectfedora39
fedoraprojectfedora40

Official sources

References

Links published by the sources. Open them with care.