# CVE-2026-102598: Werkzeug safe_join() allows Windows special device names

> An attacker can cause indefinite hangs in applications using Werkzeug on Windows by requesting paths with special device names and empty ADS markers.

- **Severity:** Medium 6.3 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 29 Sep 2026
- **Updated:** 29 Sep 2026
- **Also known as:** AZL-105654, AZL-105681, AZL-105921, CLEANSTART-2026-IZ97021, CLEANSTART-2026-JH53704, CLSA-2026-1791363861, CLSA-2026-1791366853, ECHO-f310-f2a8-f5e5, GHSA-g6x2-hccm-hh4m, MINI-4fx4-r97c-6pp3, MINI-672p-xpxm-7626, MINI-6p6r-7vmq-7hmh, MINI-92h9-r9m3-c7vm, MINI-fxv8-grph-v6m6, MINI-hpvp-vg36-rxvg, MINI-jmp8-qw7p-99gx, MINI-pgf6-2v95-5v3q, MINI-w2xm-mc39-8jwp, MINI-x853-7prg-g8pv, PYSEC-2026-4312, UBUNTU-CVE-2026-102598

## What is CVE-2026-102598?

CVE-2026-102598 is a medium-severity denial of service vulnerability in pallets werkzeug, published on 29 Sep 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 3.1.9, the safe_join function used by send_from_directory can allow a NUL: special-device path because safe_join checks the Windows device name without first removing an empty NTFS ADS marker. The trigger is that an application runs on Windows with NTFS and serves a user-specified path ending in a special device name such as NUL:. The attack mechanism is that a requested path ends in a Windows special device name with an empty ADS marker. The impact is that the special device opens successfully and the file read hangs indefinitely. This issue is fixed in version 3.1.9.

Weakness: CWE-67 (Improper Handling of Windows Device Names)

## Which versions are affected by CVE-2026-102598?

3 open source packages ship an affected version, including werkzeug and Werkzeug.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `werkzeug` | PyPI | All versions | 3.1.9 |
| `werkzeug` | PyPI | All versions | 3.1.9 |
| `Werkzeug` | PyPI | All versions | 3.1.9 |

## How do I fix CVE-2026-102598?

Upgrade werkzeug to 3.1.9 or later.

## Is CVE-2026-102598 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-102598 and fix it if it is affected.

What it is: CVE-2026-102598 is a medium-severity denial of service vulnerability in pallets werkzeug, published on 29 Sep 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-102598 in the wild and no public exploit code.

Affected packages and fixed versions:
- werkzeug (PyPI): affected all versions; fixed in 3.1.9
- werkzeug (PyPI): affected all versions; fixed in 3.1.9
- Werkzeug (PyPI): affected all versions; fixed in 3.1.9

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-102598/ (Markdown: https://insights.sbomify.com/CVE-2026-102598/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-102598
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-102598
- OSV: https://osv.dev/vulnerability/CVE-2026-102598

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-102598/
Summaries are generated and may contain mistakes; the official description above is the record.
