Patchfirst
CVE-2024-4577 KEVRansomwarePublic exploit Critical · 9.8 EPSS >99.9%

PHP-CGI OS Command Injection Vulnerability

PHP Group · PHP

Summary

The PHP-CGI module in PHP versions 8.1.x before 8.1.29, 8.2.x before 8.2.20, and 8.3.x before 8.3.8 is flawed when Apache and PHP-CGI run on Windows with certain code pages configured. Windows "Best-Fit" character replacement in command lines passed to Win32 API functions can cause PHP-CGI to misread those characters as PHP options, which can let a remote, unauthenticated attacker pass options to the PHP binary and potentially reveal script source code or run arbitrary PHP code on the server, with no user interaction required.

Official description · NVD

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.

Breakdown
79.9 / 100
Exploited
Yes, in CISA KEV
Reports
0
Tactics
10/15

How an attack unfolds

Based on mappings. Select a step to see the evidence.
  1. How attackers get in

  2. What they do

  3. What can follow

First seen exploited 2 days before it was disclosed. Public exploit code (Metasploit) was available 3 days before disclosure.

  1. Public exploit codeMetasploit3 days before
  2. First seen exploitedVulnCheck KEV evidence2 days before
  3. Disclosedday 0
  4. Added to CISA KEVknown ransomware use; EU database agrees+3 days

CISA KEV listing is when exploitation was confirmed, not necessarily the first attack.

techniques

12 , grouped by in kill-chain order 12

Initial AccessTA0001

MITRE CTID mapping of the KEV entry · how it is exploited

CVE-2024-4577 is a PHP argument injection vulnerability that allows an adversary to execute arbitrary php commands. Threat actors have been observed utilizing Cobalt Strike and the TaoWu toolkit for post-exploitation activities, such as conducting reconnaisance, establishing persistence, escalating privileges to SYSTEM level, and harvesting credentials.

ExecutionTA0002

Scheduled Task/Job T1053 also Persistence, Privilege Escalation
MITRE CTID mapping of the KEV entry · follow-on activity
MITRE CTID mapping of the KEV entry · primary impact

PersistenceTA0003

Modify Registry T1112 also Defense Impairment
MITRE CTID mapping of the KEV entry · follow-on activity
Create or Modify System Process T1543 also Privilege Escalation
MITRE CTID mapping of the KEV entry · follow-on activity

Privilege EscalationTA0004

MITRE CTID mapping of the KEV entry · follow-on activity

Credential AccessTA0006

MITRE CTID mapping of the KEV entry · follow-on activity
LSASS Memory T1003.001
MITRE CTID mapping of the KEV entry · follow-on activity

DiscoveryTA0007

MITRE CTID mapping of the KEV entry · follow-on activity

Lateral MovementTA0008

MITRE CTID mapping of the KEV entry · follow-on activity

Command and ControlTA0011

Web Protocols T1071.001
MITRE CTID mapping of the KEV entry · follow-on activity

ExfiltrationTA0010

MITRE CTID mapping of the KEV entry · follow-on activity

Detection

0 rules for this CVE · 593 general rules for its techniques

Rules for this CVE

0 that reference CVE-2024-4577 directly.

CVE-specific rules are not available in this build. Search SigmaHQ ↗

General rules for this CVE’s techniques

These detect the technique in general, not this specific vulnerability.

Exploit Public-Facing ApplicationT1190149 general rules
Command and Scripting InterpreterT105995 general rules
Scheduled Task/JobT105312 general rules
Modify RegistryT111298 general rules
Create or Modify System ProcessT15439 general rules
Exploitation for Privilege EscalationT106831 general rules
OS Credential DumpingT100337 general rules
LSASS MemoryT1003.00179 general rules
System Owner/User DiscoveryT103330 general rules
Lateral Tool TransferT15706 general rules
Web ProtocolsT1071.00142 general rules
Exfiltration Over C2 ChannelT10415 general rules

Sigma rules © SigmaHQ, Detection Rule License 1.1; linked, not reproduced.

What security researchers reported

Not named in any threat report yet

Also mentioned in 50 community threat pulses (AlienVault OTX)

Weaker evidence

Pulses are indicator collections that anyone can publish. A mention is not confirmation of exploitation.

References

21 links, grouped by NVD tag (21 duplicates merged)
↑ ↓ chooseEnter openEsc close