Skip to content

CVE-2024-4577

PHP-CGI OS Command Injection Vulnerability

  • Actively exploited
  • Used by ransomware
  • Critical · 9.8 of 10
Exploited since
12 Jun 2024
added to the CISA list
Chance of attacks
over 99.9%
in the next 30 days (FIRST EPSS)
Fix deadline
3 Jul 2024
for US federal agencies
Published
9 Jun 2024
in the NVD

What this means

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.

CISA

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.

NIST National Vulnerability Database

What to do

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

CISA's required action. If you use the product, install the vendor's update as soon as possible.

Affected

  • PHP Group PHP
  • php_group php

Official sources

Data from the NIST National Vulnerability Database, the CISA Known Exploited Vulnerabilities list, FIRST EPSS and ENISA, checked 18 Nov 2026. CVSS vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.

May we count your visit with Google Analytics? It sets cookies only if you accept. Privacy Policy