PyPI: werkzeug

CVE-2026-27199

Safety vulnerability ID: SFTY-20260219-94237

Safety legacy ID: pyup.io-86908

Affected versions of the Werkzeug package are vulnerable to Denial of Service (DoS) due to improper handling of Windows special device names in path joining logic. The safe_join() function fails to reject device-name path segments when they are preceded by other segments (for example, example/NUL), and send_from_directory() relies on safe_join() when resolving user-supplied file paths.

Created at: Mar 4, 2026Updated at: Mar 4, 2026

Overview

Werkzeug safe_join() allows Windows special device names

Advisory

Affected versions of the Werkzeug package are vulnerable to Denial of Service (DoS) due to improper handling of Windows special device names in path joining logic. The safe_join() function fails to reject device-name path segments when they are preceded by other segments (for example, example/NUL), and send_from_directory() relies on safe_join() when resolving user-supplied file paths.

Affected Package

Affecting werkzeug package, versions
<3.1.6

Also affects

---

How to Fix

Upgrade
werkzeug
to
3.1.6
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more