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| Product | Affected versions | Fixed in |
|---|---|---|
| PHPPHP | >= 8.1.* | 8.1.29 |
| FedoraFedoraproject | 40 | n/a |
| php81alpine | See advisory | 8.1.29-r0 |
| php82alpine | See advisory | 8.2.20-r0 |
| php83alpine | See advisory | 8.3.8-r0 |
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
Publicly disclosed
Jun 7, 2024
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
References
- advisorycve.org · CVERecord
- advisorylists.fedoraproject.org · PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B
- advisoryopenwall.com · 1
- exploitgithub.com · GHSA-9fcc-425m-g385
- articlenvd.nist.gov · CVE-2024-5585
FAQ
Common Questions.
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.
Affected: PHP versions >= 8.1.*; Fedora (Fedoraproject) versions 40; php81 (alpine), among others. The full list is in the CVE brief.
It is not listed in any known-exploited vulnerabilities catalog.
No, it is not currently listed in the CISA Known Exploited Vulnerabilities catalog.
Public exploit code is available.
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.
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