CVE-2026-21860 Werkzeug safe_join() allows Windows special device names with compound extensions
Werkzeug's safe_join function fails to block Windows special device names with extensions, allowing attackers to read sensitive system files on Windows servers.
- 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-21860?
CVE-2026-21860 is a medium-severity path traversal vulnerability in pallets werkzeug, published on 8 Jan 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. Prior to version 3.1.5, Werkzeug's safe_join function allows path segments with Windows device names that have file extensions or trailing spaces. On Windows, there are special device names such as CON, AUX, etc that are implicitly present and readable in every directory. Windows still accepts them with any file extension, such as CON.txt, or trailing spaces such as CON. This issue has been patched in version 3.1.5.
Weakness: CWE-67
Which versions are affected by CVE-2026-21860?
3 open source packages ship an affected version, including werkzeug and Werkzeug. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
werkzeug PyPI | All versions | 3.1.5 |
werkzeug PyPI | All versions | 3.1.5 |
Werkzeug PyPI | All versions | 3.1.5 |
Products include Palletsprojects Werkzeug.
How do I fix CVE-2026-21860?
Upgrade werkzeug to 3.1.5 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2026-21860 being exploited?
There is no known exploitation of CVE-2026-21860 in the wild and no public exploit code.
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-27199 Werkzeug safe_join() allows Windows special device names
Sources
Also known as ALPINE-CVE-2026-21860, CLEANSTART-2026-FD77375, CLEANSTART-2026-TQ31393, ECHO-f6ae-4560-1e3c, GHSA-87hc-h4r5-73f7, MINI-g7f9-qvxm-mrqc and 3 more.