Free and open · new CVEs checked every 20 minutesStatusRSSOpen dataContact

CVE-2024-4577: PHP-CGI OS Command Injection Vulnerability

100
Patch now
CRITICAL 9.8EXPLOITEDREMOTEUPGRADEMITIGATE

CVE-2024-4577 is a critical-severity flaw (CVSS 9.8) affecting php, fedora, reported as exploited in the wild. Below: why it ranks where it does, which versions are affected, what to do, and the exact commands.

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 s

Why this priority

  • Critical severity
  • EPSS top 1%: very likely to be exploited
  • Exploited in the wild (CISA KEV)
  • Used in ransomware campaigns
  • Public exploit reference
  • Covered by 4 security sources
  • CISA SSVC: automatable with total technical impact
  • Remotely exploitable, no login, no user action

A fixed release or distro patch exists.

Risk facts

CVSS score9.8 (Critical)
Attack vectorNetwork (remote)
Attack complexityLow
Privileges neededNone
User interactionNone
EPSS exploit chance100.0% (top 1%)
CISA exploited listYes, fix due 2024-07-03, used in ransomware
WeaknessCWE-78
Published2024-06-09
Last modified2026-06-17
Publisher (CNA): PHP Group · Vendor: fedoraproject · php

Share: LinkedIn · X · Reddit

Last updated 2026-06-17 · Sources: CVE Program, NVD, CISA KEV, EPSS and vendor advisories · How we score

Am I affected?

Timeline

php php UPGRADE
Affected: >= 8.1.0 and < 8.1.29 · >= 8.2.0 and < 8.2.20 · >= 8.3.0 and < 8.3.8
Fixed in: 8.1.29, 8.2.20, 8.3.8
Safe to downgrade to: a release before 8.1.0
1. Check installed version
apt-cache policy php || rpm -q php || php --version
2. UPGRADE to 8.1.29 (Debian / Ubuntu)
sudo apt update && sudo apt install --only-upgrade php
2. UPGRADE (RHEL / Amazon Linux / Fedora)
sudo dnf upgrade php
Note
Distros often backport fixes without changing the version number. Confirm with the distro advisory or changelog.
3. If no update is available yet, DOWNGRADE to a release before 8.1.0 (Debian / Ubuntu)
apt-cache madison php sudo apt install php=<VERSION_BEFORE_8.1.0> sudo apt-mark hold php
3. If no update is available yet, DOWNGRADE (RHEL / Amazon Linux / Fedora)
dnf --showduplicates list php sudo dnf downgrade php-<VERSION_BEFORE_8.1.0> sudo dnf versionlock add php
Downgrade risk
Downgrading can break dependent software and may reopen older bugs. Read the distro advisory first and test on a non-production host.
After downgrade
Restart the service, and keep the package held until a fixed release ships.
fedoraproject fedora MITIGATE
Affected: 39 · 40
Fixed in: no fixed release known
Safe to downgrade to: a release before 39
Check your OS release
cat /etc/os-release; uname -r
Debian / Ubuntu
sudo apt update && sudo apt full-upgrade
RHEL / Amazon Linux / Fedora
sudo dnf upgrade --refresh
Windows
Install the latest cumulative update from Windows Update
If no patch exists yet
OS downgrades are not safe. Apply the vendor mitigation from the advisory and restrict exposure.

Exact fixes by distribution

A distro patch exists: prefer upgrading over downgrading.
Fedora ELN · gram_grep · FIXED · 0.10.4-1.eln159 · FEDORA-2026-0808475f2a · source
sudo dnf upgrade --advisory=FEDORA-2026-0808475f2a
Fedora 46 · wesnoth · FIXED · 1.19.29-1.fc46 · FEDORA-2026-58f458e24e · source
sudo dnf upgrade --advisory=FEDORA-2026-58f458e24e
Ubuntu 20.04 · php7.4 · NOT AFFECTED
Ubuntu 22.04 · php8.1 · NOT AFFECTED
Ubuntu 24.04 · php8.3 · NOT AFFECTED
Debian 12 · php8.2 · NOT AFFECTED
RHEL 10 · php · NOT AFFECTED
RHEL 6 · php · NOT AFFECTED
RHEL 7 · php · NOT AFFECTED
RHEL 8 · php:7.4/php · NOT AFFECTED
RHEL 8 · php:8.0/php · NOT AFFECTED

Public exploits and detection

Public code exists for this CVE. Treat unpatched systems as at risk, and only run PoCs in a lab.

Advisories and coverage

Official advisories

Research and news

Verify at the official source NVD · CVE Program · CISA KEV catalog · Report a problem with this page
Scores and fixes here are computed automatically from those and other public sources. Confirm with the vendor advisory before changing production systems.

Quick answers

How do I fix CVE-2024-4577?

php: upgrade to 8.1.29, 8.2.20, 8.3.8; fedora: mitigate or apply the listed mitigation. Exact commands for each OS are on this page.

Is CVE-2024-4577 being exploited?

Yes. CVE-2024-4577 is on the CISA Known Exploited Vulnerabilities list, so treat it as patch-now.

What does CVE-2024-4577 affect?

CVE-2024-4577 affects php, fedora. Severity is critical (CVSS 9.8). 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

How urgent is CVE-2024-4577?

Priority 100/100. Critical severity; EPSS top 1%: very likely to be exploited; Exploited in the wild (CISA KEV); Used in ransomware campaigns; Public exploit reference; Covered by 4 security sources; CISA SSVC: automatable with total technical impact; Remotely exploitable, no login, no user action

Software pages

PHP vulnerabilities · Windows vulnerabilities

Related CVEs

References

← Back to latest CVEs

Get the weekly exploited-CVE digest by emailThe CVEs being attacked this week and how to fix them. No spam, unsubscribe any time.