cbcvebase.
CVE-2024-1874
published 2024-04-29

CVE-2024-1874: 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…

PriorityP275critical9.4CVSS 3.1
AVNACLPRNUINSUCHIHAL
EPSS
32.57%
98.1th percentile
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.

Affected

22 ranges
VendorProductVersion rangeFixed in
debianphp7.4
debianphp8.2
fedoraprojectfedora
fedoraprojectfedora
msrcazl3_php_8.3.6-1_on_azure_linux_3.0
msrcazl3_php_8.3.8-1_on_azure_linux_3.0
msrcazure_linux_3.0_arm
msrcazure_linux_3.0_x64
msrccbl2_php_8.1.22-2_on_cbl_mariner_2.0
msrccbl2_php_8.1.28-1_on_cbl_mariner_2.0
msrccbl2_php_8.1.29-1_on_cbl_mariner_2.0
msrccbl_mariner_2.0_arm
msrccbl_mariner_2.0_x64
phpphp>= 8.1.0 < 8.1.298.1.29
phpphp>= 8.1.0 < 8.1.288.1.28
phpphp>= 8.2.0 < 8.2.208.2.20
phpphp>= 8.2.0 < 8.2.188.2.18
phpphp>= 8.3.0 < 8.3.88.3.8
phpphp>= 8.3.0 < 8.3.58.3.5
php_groupphp>= 8.1.* < 8.1.298.1.29
php_groupphp>= 8.2.* < 8.2.208.2.20
php_groupphp>= 8.3.* < 8.3.88.3.8

Detection & IOCsextracted from sources · hover to see the quote

  • Exploitation targets PHP's proc_open() when called with array syntax on Windows; monitor for proc_open() calls where command arguments contain shell metacharacters or batch-file injection sequences (e.g., '&', '|', ';', '%', '^') passed as array elements.
  • The bypass of the CVE-2024-1874 fix is triggered specifically when the command name includes trailing spaces; detection logic should flag proc_open() array-syntax calls where the first element (command name) has trailing whitespace.
  • Exploitation is exclusive to Windows environments and leverages the implicit use of cmd.exe by the CreateProcess function when executing batch files; alert on PHP processes spawning cmd.exe with batch file arguments on Windows hosts.
  • ·Vulnerability is Windows-only; Linux/Unix PHP deployments are not affected by this command injection vector.
  • ·Affected PHP versions for the original CVE-2024-1874: 8.1.* before 8.1.28, 8.2.* before 8.2.18, 8.3.* before 8.3.5. The bypass (CVE-2024-5585) extends affected ranges to 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8.
  • ·No Red Hat Enterprise Linux products are affected by this CVE across all supported PHP streams.

CVSS provenance

nvdv3.19.4CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L
vendor_debian9.4LOW
vendor_msrc9.4CRITICAL
vendor_redhat9.4CRITICAL
Stop checking back — get the weekly exploitation signal.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.