Skip to content
On CISA KEVCritical

CVE-2024-4577PHP OS Command Injection

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.

Published Jun 7, 2024 · Updated Nov 5, 2026 · Also known as ALPINE-CVE-2024-4577, BIT-libphp-2024-4577, BIT-php-2024-4577, BIT-php-min-2024-4577, CGA-gmwp-fhmg-pqfm, CGA-p643-hjxc-p95c, CGA-v39m-ww8v-h7fq, CGA-x9h3-83w9-5jxh, ECHO-96a3-1302-f796, GHSA-3qgc-jrrr-25jv, GHSA-vxpp-6299-mxw3, openSUSE-SU-2024:14376-1

Key Facts

Patch immediately
  • CVE-2024-4577 is a critical-severity vulnerability (CVSS 9.8 v3.1) affecting PHP, Fedora (Fedoraproject), php81 (alpine) and 22 more products.
  • It is exploited in the wild, listed in CISA KEV, Industry KEV feed, CIRCL KEV, ENISA EUVD since Jun 7, 2024 and is known to be used in ransomware campaigns. Public exploit code is available.
  • EPSS estimates a 100% probability of exploitation in the next 30 days.
  • Fixed versions are available, including libphp 8.1.29, libphp 8.2.20, libphp 8.3.8.
  • Brandefense priority: patch immediately, because it is listed as exploited in the wild.

Scores

CVSS v3.1

9.8

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

EPSS (30-day exploit likelihood)

100%

Higher than 99.9% of all scored CVEs

Exploit maturity

Exploited (KEV)

ATLAS score

86/100

Publication score, see How it works

Exploitation Verdict

KEV listed

Jun 12, 2024

5 days after publication

Federal due date

Jul 3, 2024

Overdue

Ransomware use

Known

Attributed actors

Exploit & Defence Guidance

Exploit maturity

Exploited (KEV)

Public exploit code

7

Proof-of-concept links

In-the-wild evidence

20

Reports of active use

Required action (CISA): Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.

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.

Known-Exploited Catalog Listings

CatalogAddedRemediation dueRansomware use
CISA KEVJun 12, 2024Jul 3, 2024Known
Industry KEV feedJun 7, 2024Jul 3, 2024Known
CIRCL KEVJun 7, 2024Jul 3, 2024Known
ENISA EUVDJun 12, 2024n/aNot reported

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

Affected Products

81 affected entries in total
ProductAffected versionsFixed in
PHPPHP>= 8.1.*8.1.29
FedoraFedoraproject39, 40n/a
php81alpineSee advisory8.1.29-r0
php82alpineSee advisory8.2.20-r0
php83alpineSee advisory8.3.8-r0
20 more affected products in the full CVE brief

Patched Releases

libphp

8.1.29, 8.2.20, 8.3.8

PHP

8.1.29, 8.1.29-1, 8.2.20, 8.3.8, 8.3.8-1

php-7.2

7.2.34+e1

php-8.1

8.1.29-r0

php-8.2

8.2.20-r0

php-min

8.1.29, 8.2.20, 8.3.8

php8

8.3.12-1.1

php8-bcmath

8.3.12-1.1

php8-bz2

8.3.12-1.1

php8-calendar

8.3.12-1.1

php8-cli

8.3.12-1.1

php8-ctype

8.3.12-1.1

php8-curl

8.3.12-1.1

php8-dba

8.3.12-1.1

php8-devel

8.3.12-1.1

php8-dom

8.3.12-1.1

php8-enchant

8.3.12-1.1

php8-exif

8.3.12-1.1

php8-ffi

8.3.12-1.1

php8-fileinfo

8.3.12-1.1

php8-ftp

8.3.12-1.1

php8-gd

8.3.12-1.1

php8-gettext

8.3.12-1.1

php8-gmp

8.3.12-1.1

php8-iconv

8.3.12-1.1

Timeline

  1. Publicly disclosed

    Jun 7, 2024

  2. Added to Industry KEV feed

    Jun 7, 2024

  3. Added to CIRCL KEV

    Jun 7, 2024

  4. Added to CISA KEV

    Jun 12, 2024

  5. Added to ENISA EUVD

    Jun 12, 2024

  6. Last updated

    Nov 5, 2026

Weakness Type

  • CWE-20 Improper Input Validation
  • CWE-78 Improper Neutralization of Special Elements used in an OS Command

FAQ

Common Questions.

Is CVE-2024-4577 On Your Attack Surface?

Brandefense matches it against the products discovered on your perimeter and opens a finding the day a CVE like this is listed.

Request A Demo

More vulnerabilities

Figures as of Dec 2, 2026. Compiled by Brandefense technologies from public vulnerability catalogs; scoring as described in How it works.

To report an error, contact Brandefense.