CVE-2024-4577

Argument Injection in PHP-CGI

  • Critical 9.8
  • Exploited: added to CISA KEV 12 Jun 2024
  • Used in ransomware campaigns

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.

Key facts

Published
9 Jun 2024
Last changed
21 Oct 2025
Assigned by
php
KEV added
12 Jun 2024
KEV fix due
3 Jul 2024
Used in ransomware
Yes, according to CISA
EPSS
99.987% likely to be exploited in the next 30 days, higher than 99.984% of CVEs (scores for 15 Nov 2026)
SSVC (CISA)
Exploitation: active; Automatable: yes; Technical impact: total

Severity scores

Each score is shown as its source gave it. They are not averaged or merged.

  • 9.8CVSS 3.1, Criticalfrom the CNA (php)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

What to do

  • Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.CISA KEV required action

Historical context and remediation

This reference retains the original CVE publication date. A recent record update does not mean a new attack occurred.

No separately sourced impact summary is available on this page yet. Consult the description, version data and dated exploitation evidence.

Version statuses below come from the CNA. An “unaffected” version is not necessarily a currently supported release or proof of a patch date. EPSS is a dated risk estimate, not a count of historical attacks.

Read the original CVE record.

Affected products

VendorProductVersions
PHP GroupPHP
  • Default status: affected
  • 8.1.* up to but excluding 8.1.29 (affected)
  • 8.2.* up to but excluding 8.2.20 (affected)
  • 8.3.* up to but excluding 8.3.8 (affected)

Timeline

  1. 9 Jun 2024 Published
  2. 12 Jun 2024 CVE-2024-4577 added to CISA KEV
  3. 12 Jun 2024 Added to the CISA KEV catalogue

Weakness

Practice this bug class

HackZoneLabs has a hands-on lab on OS command injection (CWE-78).

References