Impact
Werkzeug’s safe_join function, used by the send_from_directory helper, can accept a user‑supplied path that ends with a Windows special device name such as NUL:. When the path contains an empty NTFS alternate data stream marker, safe_join fails to strip the marker before checking the device name, allowing the function to resolve the path to the special device. Accessing the device causes a file read operation to hang indefinitely, which results in a denial of service for the application.
Affected Systems
The issue affects versions of Werkzeug older than 3.1.9, including 3.1.8 and earlier. Any instance of Werkzeug on Windows running the send_from_directory routine that accepts user controlled paths is vulnerable.
Risk and Exploitability
The CVSS score of 6.3 indicates moderate severity. No EPSS score is available, and the vulnerability is not listed in CISA KEV. The trigger occurs when an application runs on a Windows system with NTFS and serves a request containing a path that ends with a Windows special device name. Although the description does not explicitly state the attack vector, it is inferred that a remote user could exploit the vulnerability by issuing an HTTP request to the web application. The lack of binary exploitation or local privilege escalation means the main impact is a service interruption, and the exploit does not require high privileges beyond the application’s normal execution context.
OpenCVE Enrichment
Github GHSA