CVE-2026-27199 Werkzeug safe_join() allows Windows special device names
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.
| Package | Affected | Fixed in |
|---|---|---|
werkzeug PyPI | All versions | 3.1.6 |
werkzeug PyPI | All versions | 3.1.6 |
werkzeug PyPI | All versions | 3.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.
Other vulnerabilities in pallets werkzeug
- CVE-2022-29361 Other in n/a
- CVE-2023-46136 Werkzeug DoS: High resource usage when parsing multipart/form-data containing a large part with CR/LF character at the beginning
- CVE-2023-25577 Werkzeug may allow high resource usage when parsing multipart form data with many fields
- CVE-2019-14322 Pallets Werkzeug vulnerable to Path Traversal
- CVE-2026-21860 Werkzeug safe_join() allows Windows special device names with compound extensions
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.