CVE-2024-1874: PHP · Improper Encoding or Escaping of Output
Affects PHPSource CVE Database V5
Not known to be exploited · 32% EPSS · CVSS 9.4 Critical · fixed in 8.3.5 : patch PHP as a priority.
Data as of 25 Oct 2026, 19:02 UTC
- EPSS
- 32.5% chance of exploitation in 30 days – higher than 98% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 8.3.5, 8.2.18, 8.1.28
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:LExploitation evidence
Disclosed: evidence found.
CVE published 14 May 2024
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-25.
What to do
Upgrade debian/php to 8.3.5, 8.2.18 or 8.1.28.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
Debiandebian/phppkg:deb/debian/phpOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
1. Immediately upgrade PHP installations to versions 8.1.28, 8.2.18, or 8.3.5 or later where the vulnerability is patched. 2. If immediate patching is not possible, restrict usage of proc_open() with array syntax on Windows systems, especially where user input controls command arguments. 3. Implement strict input validation and sanitization on all user-supplied data that might be passed to system commands, employing whitelisting approaches where feasible. 4. Employ application-layer firewalls or web application firewalls (WAFs) to detect and block suspicious command injection patterns targeting proc_open() usage. 5. Monitor logs for unusual command execution attempts or anomalies in PHP process spawning. 6. Limit PHP execution privileges and isolate PHP applications in containers or sandboxes to reduce impact scope. 7. Conduct security audits and code reviews focusing on usage of proc_open() and other system command invocations. 8. Educate developers about secure coding practices related to command execution and escaping on Windows platforms. 9. Maintain up-to-date backups and incident response plans to quickly recover from potential compromises.
Description
In PHP versions 8.1.* before 8.1.28, 8.2.* before 8.2.18, 8.3.* before 8.3.5, 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.
References
- github.com/php/php-src/security/advisories/GHSA-pc52-254m-w9w7 (opens in a new tab)
- openwall.com/lists/oss-security/2024/04/12/11 (opens in a new tab)
- security.netapp.com/advisory/ntap-20240510-0009/ (opens in a new tab)
- openwall.com/lists/oss-security/2024/06/07/1 (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B/ (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/W45DBOH56NQDRTOM2DN2LNA2FZIMC3PK/ (opens in a new tab)
- vicarius.io/vsociety/posts/command-injection-vulnerability-in-php-on-windows-systems-cve-2024-1874-and-cve-2024-5585 (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZGWIK3HMBACERGB4TSBB2JUOMPYY2VKY/ (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KJZK3X6B7FBE32FETDSMRLJXTFTHKWSY/ (opens in a new tab)
- kb.cert.org/vuls/id/123335 (opens in a new tab)