All reports
Unknown

php: Fail to Escape Arguments Properly in Microsoft Windows

Affected versions

Affected versions
Unknown
Fixed version
Not reported
Affected versions
Unknown
Fixed version
Not reported

Exploitation

CVE-2024-1874

Probability of exploitation in the next 30 days: 32.80%

FIRST EPSS · 2026-11-21

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.

A command injection flaw was found in PHP, exclusive to Windows environments. This flaw allows an attacker to perform command injection on Windows applications that indirectly depend on the CreateProcess function in specific conditions. The CreateProcess function implicitly uses cmd.exe when executing batch files, which has complicated parsing rules for arguments that have not fully escaped. It is possible to inject commands if an attacker can control part of the command arguments of the batch file.