Wavense
VulnerabilitiesVendorsMy Stack
Wavense© 2026 Wavense. All rights reserved.Privacy PolicyTerms & Conditions
Vulnerabilities/CVE-2024-4577
Vulnerability dossier

CVE-2024-4577

PHP-CGI Windows Arbitrary Code Execution via Best-Fit

VendorphpPublishedJun 9, 2024SourceNVDWeaknessCWE-78
Act now

Actively exploited in the wild. Patch or mitigate immediately — don't wait for a maintenance window.

⚙ WeaponizedMetasploit module availableopen ↗PoCPublic exploit on Exploit-DB#52331 ↗
Severity
Critical · 9.8
CVSS base score
Exploitation
In the wild
CISA KEV · Metasploit · Exploit-DB
Predicted risk
100% model
EPSS forecast — overtaken by confirmed exploitation
Exposure
Internet-facing
Exploitable remotely, no login, no user action
01

What's the risk?

An unauthenticated attacker, remotely over the network, with no user interaction, can fully compromise the system — steal data, tamper with it and take it offline.

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.

How it's exploitedMITRE ATT&CK · 2 observed in the wild
Initial Access
T1190Exploit Public-Facing Applicationobserved
Execution
T1059Command and Scripting Interpreterobserved

Techniques marked “observed” are corroborated by threat intelligence; the rest are inferred from the weakness type (CWE) and attack vector.

02

Who's exploiting it?

Corroborated threat activity referencing this CVE — with source and confidence, not inference.

Confirmed exploited in the wild. CISA KEV · catalogued Jun 12, 2024
campaignRansomware campaigns
90
CISA KEV
Observed techniques MITRE-analysed · CTID Mappings Explorer
T1059Command and Scripting InterpreterobservedT1190Exploit Public-Facing Applicationobserved

These techniques were analysed against this CVE's real-world exploitation — the matching entries in the ATT&CK chain above are marked “observed”.

03

Are we affected?

5
  • Affectedfedoraproject · fedora39
  • Affectedfedoraproject · fedora40
  • Affectedphp · phpall versions
  • Affectedphp · phpall versions
  • Affectedphp · phpall versions
04

What to do

Generated by Wavense from the CVE record — an immediate mitigation and the permanent fix.

  1. !

    Mitigate now

    Immediately discontinue using PHP-CGI with Apache on Windows. If this configuration is absolutely essential, deploy a robust Web Application Firewall (WAF) to inspect and filter command-line input, specifically blocking suspicious character sequences or attempts to inject PHP options. Implement strict network segmentation to limit attacker lateral movement if a compromise occurs.

  2. ✓

    Permanent fix

    Upgrade PHP to a patched version immediately to resolve this vulnerability. Specifically, update PHP 8.1.* to 8.1.29 or later, PHP 8.2.* to 8.2.20 or later, and PHP 8.3.* to 8.3.8 or later. Ensure all related web server configurations, such as Apache, are compatible with the updated PHP versions after the upgrade.

Technical details— weakness, CVSS vector & calculator, related CVEs

Business impact

An attacker can execute arbitrary PHP code on the server, leading to complete system compromise and potential data theft, modification, or deletion. This allows for full control over the affected web server, enabling defacement, service disruption, or further network penetration. The vulnerability also enables source code disclosure of scripts, exposing sensitive application logic and credentials.

Weakness

1
CWE-78Common Weakness Enumeration · MITRE definition

CVSS 3.1 details

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
0.0
/ 10.0 base
Critical severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Exploitability metrics
Attack VectorAV
Remotely exploitable across a network
Attack ComplexityAC
No special conditions required
Privileges RequiredPR
No authorization needed
User InteractionUI
No user participation needed
Impact metrics
ScopeS
Impact confined to the vulnerable component
ConfidentialityC
Total loss of confidentiality
IntegrityI
Total loss of integrity
AvailabilityA
Total loss of availability

Related vulnerabilities

Other CVEs affecting fedora

NVD
10.0Critical
CVE-2015-3306KEV⚙ WeaponizedExploit likely

The mod_copy module in ProFTPD 1.3.5 allows remote attackers to read and write to arbitrary files via the site cpfr and site cpto commands.

fedoraprojectCWE-284Improper Access ControlNetworkLow effortNo authNo interactionCIA
2015-05-18
NVD
9.8Critical
CVE-2021-44026KEVExploit likely

Roundcube before 1.3.17 and 1.4.x before 1.4.12 is prone to a potential SQL injection via search or search_params.

debianCWE-89SQL InjectionNetworkLow effortNo authNo interactionCIA
2021-11-18
NVD
9.8Critical
CVE-2021-42013KEV⚙ WeaponizedExploit likely

It was found that the fix for CVE-2021-41773 in Apache HTTP Server 2.4.50 was insufficient. An attacker could use a path traversal attack to map URLs to files outside the directories configured by Alias-like directives. If files outside of these directories are not protected by the usual default configuration "require all denied", these requests can succeed. If CGI scripts are also enabled for these aliased pathes, this could allow for remote code execution. This issue only affects Apache 2.4.49 and Apache 2.4.50 and not earlier versions.

oracleCWE-22Path TraversalNetworkLow effortNo authNo interactionCIA
2021-10-07
NVD
9.8Critical
CVE-2021-39226KEVExploit likely

Grafana is an open source data visualization platform. In affected versions unauthenticated and authenticated users are able to view the snapshot with the lowest database key by accessing the literal paths: /dashboard/snapshot/:key, or /api/snapshots/:key. If the snapshot "public_mode" configuration setting is set to true (vs default of false), unauthenticated users are able to delete the snapshot with the lowest database key by accessing the literal path: /api/snapshots-delete/:deleteKey. Regardless of the snapshot "public_mode" setting, authenticated users are able to delete the snapshot with the lowest database key by accessing the literal paths: /api/snapshots/:key, or /api/snapshots-delete/:deleteKey. The combination of deletion and viewing enables a complete walk through all snapshot data while resulting in complete snapshot data loss. This issue has been resolved in versions 8.1.6 and 7.5.11. If for some reason you cannot upgrade you can use a reverse proxy or similar to block access to the literal paths: /api/snapshots/:key, /api/snapshots-delete/:deleteKey, /dashboard/snapshot/:key, and /api/snapshots/:key. They have no normal function and can be disabled without side effects.

grafanaCWE-287Improper AuthenticationNetworkLow effortNo authNo interactionCIA
2021-10-05
NVD
9.8Critical
CVE-2021-41773KEV⚙ WeaponizedExploit likely

A flaw was found in a change made to path normalization in Apache HTTP Server 2.4.49. An attacker could use a path traversal attack to map URLs to files outside the directories configured by Alias-like directives. If files outside of these directories are not protected by the usual default configuration "require all denied", these requests can succeed. If CGI scripts are also enabled for these aliased pathes, this could allow for remote code execution. This issue is known to be exploited in the wild. This issue only affects Apache 2.4.49 and not earlier versions. The fix in Apache HTTP Server 2.4.50 was found to be incomplete, see CVE-2021-42013.

oracleCWE-22Path TraversalNetworkLow effortNo authNo interactionCIA
2021-10-04
NVD
9.8Critical
CVE-2021-1871KEV

A logic issue was addressed with improved restrictions. This issue is fixed in macOS Big Sur 11.2, Security Update 2021-001 Catalina, Security Update 2021-001 Mojave, iOS 14.4 and iPadOS 14.4. A remote attacker may be able to cause arbitrary code execution. Apple is aware of a report that this issue may have been actively exploited..

appleNetworkLow effortNo authNo interactionCIA
2021-04-02
NVD
9.8Critical
CVE-2021-1870KEV

A logic issue was addressed with improved restrictions. This issue is fixed in macOS Big Sur 11.2, Security Update 2021-001 Catalina, Security Update 2021-001 Mojave, iOS 14.4 and iPadOS 14.4. A remote attacker may be able to cause arbitrary code execution. Apple is aware of a report that this issue may have been actively exploited..

appleNetworkLow effortNo authNo interactionCIA
2021-04-02
NVD
9.8Critical
CVE-2020-16846KEV⚙ WeaponizedExploit likely

An issue was discovered in SaltStack Salt through 3002. Sending crafted web requests to the Salt API, with the SSH client enabled, can result in shell injection.

saltstackCWE-78OS Command InjectionNetworkLow effortNo authNo interactionCIA
2020-11-05
0.0
/ 10.0 base
Critical severity
Key facts
CVE ID
CVE-2024-4577
Published
Jun 9, 2024
Last modified
Nov 3, 2025
CVSS
9.8 (v3.1)
EPSS
99.99%
In CISA KEV
Yes
Confidence
100/100
Weakness
CWE-78
Timeline
  1. Jun 9, 2024Published to NVDNVD
  2. Nov 3, 2025Record last modifiedNVD
  3. Aug 16, 2026AI analysis generatedWavense
View on NVD