REDHAT-BUG-2541645: Medium severity PHP PHP vulnerability
On Windows, PHP's filesystem and stream APIs do not reject reserved device names such as CON, PRN, AUX, NUL, COM1 to COM9, LPT1 to LPT9, CONIN$ and CONOUT$ when they appear as a component of a path. An attacker-controlled filename therefore reaches CreateFileW() and opens a device instead of the regular file the application expected, which can block or hang the request and exhaust worker processes.
Affected Software
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications running PHP on Windows are exposed when they use PHP filesystem or stream APIs with attacker-controlled filenames or path components. The impact is request blocking or hangs that can exhaust available worker processes.
What does an attacker need to exploit it?
An attacker needs to control a filename or another component of a path passed to a PHP filesystem or stream API. Using a reserved Windows device name such as CON, PRN, AUX, NUL, COM1 through COM9, LPT1 through LPT9, CONIN$, or CONOUT$ can cause PHP to open a device via CreateFileW() rather than the intended regular file.
What can be done before a fix is available?
Validate and reject reserved Windows device names in every attacker-influenced path component before passing the path to PHP filesystem or stream APIs. This should include CON, PRN, AUX, NUL, COM1 to COM9, LPT1 to LPT9, CONIN$, and CONOUT$.