---
id: "CVE-2026-102598"
page: "https://infrastack.ai/live/CVE-2026-102598"
kind: "vulnerability"
aliases: ["CVE-2026-102598", "GHSA-g6x2-hccm-hh4m"]
title: "Werkzeug safe_join() allows Windows special device names"
severity: "medium"
cvss: 6.3
epss: 0.0037
exploited: false
status: "open"
category: "package"
products: [{"name": "werkzeug", "note": "<3.1.9", "fixed": ["3.1.9"], "affected": "< 3.1.9", "ecosystem": "pypi"}]
ecosystems: ["pypi"]
tags: ["cwe-67", "flask", "package", "python", "werkzeug", "windows"]
not_affected_if: ["linux-only", "no-user-supplied-paths"]
published_at: "2026-09-27T18:38:58+00:00"
first_seen_at: "2026-11-09T22:53:21+00:00"
updated_at: "2026-11-09T23:01:00+00:00"
sources: [{"source": "ghsa-repo", "url": "https://github.com/pallets/werkzeug/security/advisories/GHSA-g6x2-hccm-hh4m", "first_seen_at": "2026-11-09T22:53:21+00:00"}, {"source": "ghsa", "url": "https://github.com/advisories/GHSA-g6x2-hccm-hh4m", "first_seen_at": "2026-11-09T22:57:50+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-102598", "first_seen_at": "2026-11-09T23:10:12+00:00"}]
exploit_sources: [{"type": "epss", "score": 0.0037, "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-102598"}]
---

# Werkzeug safe_join() allows Windows special device names

Link for people: https://infrastack.ai/live/CVE-2026-102598 (this .md is for agents)

Werkzeug's safe_join function, used by send_from_directory, accepts Windows special device names such as NUL: when they carry an empty NTFS alternate data stream marker. On Windows with NTFS, a request for such a path opens successfully but the read hangs indefinitely, which is a denial of service rather than file disclosure.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:werkzeug affected < 3.1.9 fixed 3.1.9

## How to check

- Check the installed version with `pip show werkzeug` and compare it to the affected range below.
- Look for `send_from_directory` or `safe_join` calls in the application code that serve user-supplied paths.
- Confirm whether the application runs on Windows with NTFS.

## Fix

- `werkzeug` `3.1.9` (fixed version per the product data; affected below `3.1.9`)

## Timeline

- 2026-11-09T22:53:21+00:00 ghsa-repo https://github.com/pallets/werkzeug/security/advisories/GHSA-g6x2-hccm-hh4m
- 2026-11-09T22:57:50+00:00 ghsa https://github.com/advisories/GHSA-g6x2-hccm-hh4m
- 2026-11-09T23:10:12+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-102598

## Documents

- [advisory] Maintainer's advisory: github.com https://github.com/pallets/werkzeug/security/advisories/GHSA-g6x2-hccm-hh4m
- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/pallets/werkzeug/security-advisories/GHSA-g6x2-hccm-hh4m
- [fix] Patch: github.com https://github.com/pallets/werkzeug/pull/3309
- [fix] Patch: github.com https://github.com/pallets/werkzeug/commit/8d77320bcdf3a34941ec06dcf16b03c065cd21b6
- [fix] Release: github.com https://github.com/pallets/werkzeug/releases/tag/3.1.9

## From the sources

Werkzeug's `safe_join` function allows Windows device names as filenames when they have an empty ADS marker on NTFS.

This was previously reported as https://github.com/pallets/werkzeug/security/advisories/GHSA-hgf8-39gv-g3f2, but the added filtering failed to account for the fact Windows allows special device names with an empty ADS marker, such as `NUL:`.

`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 NTFS, and the requested path ends with a special device name, the file will be opened successfully, but reading will hang indefinitely.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
