CVE-2026-27199 Werkzeug safe_join() allows Windows special device names

Medium 6.3 Published Updated

Attackers can cause indefinite hangs in Windows-based applications using Werkzeug by requesting paths ending in special device names.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-27199?

CVE-2026-27199 is a medium-severity denial of service vulnerability in pallets werkzeug, published on 21 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Werkzeug is a comprehensive WSGI web application library. Versions 3.1.5 and below, the safe_join function allows Windows device names as filenames if preceded by other path segments. This was previously reported as GHSA-hgf8-39gv-g3f2, but the added filtering failed to account for the fact that safe_join accepts paths with multiple segments, such as example/NUL. The function send_from_directory uses safe_join to safely serve files at user-specified paths under a directory. If the application is running on Windows, and the requested path ends with a special device name, the file will be opened successfully, but reading will hang indefinitely. This issue has been fixed in version 3.1.6.

Weakness: CWE-67

Which versions are affected by CVE-2026-27199?

3 open source packages ship an affected version, including werkzeug. It affects 1 product.

PackageAffectedFixed in
werkzeug PyPIAll versions3.1.6
werkzeug PyPIAll versions3.1.6
werkzeug PyPIAll versions3.1.6

Products include Palletsprojects Werkzeug.

How do I fix CVE-2026-27199?

Upgrade werkzeug to 3.1.6 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2026-27199 being exploited?

There is no known exploitation of CVE-2026-27199 in the wild and no public exploit code.

Public exploit code: 1 proofs of concept on GitHub.

Sources

Also known as ALPINE-CVE-2026-27199, CLEANSTART-2026-DZ40075, CLEANSTART-2026-XY59001, ECHO-1285-c76d-e885, GHSA-29vq-49wr-vm6x, MINI-g328-rhhc-47v3 and 3 more.

Is CVE-2026-27199 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free