Impact
Werkzeug is a Python WSGI library used to build web applications. A flaw was discovered in the safe_join helper function used to combine path components before version 3.1.5. The function fails to reject Windows‑specific device names such as CON, AUX, PRN, NUL, COM1–COM9, and LPT1–LPT9 when those names are combined with file extensions or trailing spaces. Because Windows treats these names as built‑in devices accessible from any directory, an attacker can construct a request that resolves to a device stream and read its contents or enumerate the devices, exposing data that the application should not normally access.
Affected Systems
The vulnerability affects all releases of Werkzeug prior to 3.1.5 that run on Windows operating systems. It is relevant to any Python web application that includes Werkzeug as a dependency, such as Flask or other frameworks that rely on Werkzeug’s safe_join for file handling. The issue does not exist in non‑Windows environments, nor in Werkzeug versions 3.1.5 and newer, where the fix is already in place.
Risk and Exploitability
The CVSS score is 6.3, indicating a moderate severity. Ephemeral probability of exploitation is low (< 1 %) and the vulnerability is not listed in the CISA KEV catalog, suggesting no known widespread exploitation. The attack requires that the application uses safe_join to construct a file path on a Windows host; an attacker could supply a crafted path or file name, cause safe_join to resolve to a device name, and then read the resulting device stream. The low exploitation likelihood, coupled with the availability of a straightforward patch, means the risk to a well‑maintained systems portfolio is modest.
OpenCVE Enrichment
Github GHSA