Skip to content
WatchlistHigh

CVE-2024-5585PHP OS Command Injection

In PHP versions 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8, the fix for CVE-2024-1874 does not work if the command name includes trailing spaces.

Published Jun 7, 2024 · Updated Sep 8, 2026 · Also known as BIT-libphp-2024-5585, BIT-php-2024-5585, BIT-php-min-2024-5585, GHSA-9fcc-425m-g385

Key Facts

Patch immediately
  • CVE-2024-5585 is a high-severity vulnerability (CVSS 8.8 v3.1) affecting PHP, Fedora (Fedoraproject), php81 (alpine) and 8 more products.
  • It is not listed in any known-exploited vulnerabilities catalog. Public exploit code is available.
  • EPSS estimates a 29% 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 public exploit code exists for a high-severity flaw.

Scores

CVSS v3.1

8.8

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

EPSS (30-day exploit likelihood)

29%

Higher than 98.1% of all scored CVEs

Exploit maturity

Proof of concept

ATLAS score

39/100

Publication score, see How it works

Exploitation Verdict

KEV listed

Not listed

Federal due date

None

No federal due date

Ransomware use

Not reported

Attributed actors

None named

Exploit & Defence Guidance

Exploit maturity

Proof of concept

Public exploit code

1

Proof-of-concept links

In-the-wild evidence

0

Reports of active use

Description

In PHP versions 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8, the fix for CVE-2024-1874 does not work if the command name includes trailing spaces. Original issue: when using proc_open() command with array syntax, due to insufficient escaping, if the arguments of the executed command are controlled by a malicious user, the user can supply arguments that would execute arbitrary commands in Windows shell.

Affected Products

17 affected entries in total
ProductAffected versionsFixed in
PHPPHP>= 8.1.*8.1.29
FedoraFedoraproject40n/a
php81alpineSee advisory8.1.29-r0
php82alpineSee advisory8.2.20-r0
php83alpineSee advisory8.3.8-r0
6 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-8.1

8.1.29-r0

php-8.2

8.2.20-r0

php-min

8.1.29, 8.2.20, 8.3.8

php81

8.1.29-r0

php82

8.2.20-r0

php83

8.3.8-r0

Timeline

  1. Publicly disclosed

    Jun 7, 2024

  2. Last updated

    Sep 8, 2026

Weakness Type

  • CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
  • CWE-116 Improper Encoding or Escaping of Output

FAQ

Common Questions.

Is CVE-2024-5585 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

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

To report an error, contact Brandefense.