Vulnerability · Published Nov 29, 2025 · Assigned by GitHub_M

CVE-2025-66221Werkzeug safe_join() allows Windows special device names

Medium 6.3

In plain English

A medium-severity security flaw in werkzeug from pallets. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.5% (higher than 46% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 4.0)6.3Medium
Exploit odds (30 days)0.5%top 54.0% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

Werkzeug is a comprehensive WSGI web application library. Prior to version 3.1.4, Werkzeug's safe_join function allows path segments with Windows device names. On Windows, there are special device names such as CON, AUX, etc that are implicitly present and readable in every directory. 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 patched in version 3.1.4.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Alpine:v3.24py3-werkzeug3.1.4-r0ALPINE-CVE-2025-66221
PyPIwerkzeug3.1.4GHSA-hgf8-39gv-g3f2
PyPIwerkzeug3.1.4PYSEC-2026-2046
Ubuntu:22.04:LTSpython-werkzeugno fix listedUBUNTU-CVE-2025-66221
Ubuntu:24.04:LTSpython-werkzeugno fix listedUBUNTU-CVE-2025-66221
Ubuntu:25.10python-werkzeugno fix listedUBUNTU-CVE-2025-66221

Affected products (as reported)

VendorProductVersions
pallets werkzeug < 3.1.4

Weakness: CWE-67 · 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

References