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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.24 | py3-werkzeug | 3.1.4-r0 | ALPINE-CVE-2025-66221 |
| PyPI | werkzeug | 3.1.4 | GHSA-hgf8-39gv-g3f2 |
| PyPI | werkzeug | 3.1.4 | PYSEC-2026-2046 |
| Ubuntu:22.04:LTS | python-werkzeug | no fix listed | UBUNTU-CVE-2025-66221 |
| Ubuntu:24.04:LTS | python-werkzeug | no fix listed | UBUNTU-CVE-2025-66221 |
| Ubuntu:25.10 | python-werkzeug | no fix listed | UBUNTU-CVE-2025-66221 |
Affected products (as reported)
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
- https://github.com/pallets/werkzeug/security/advisories/GHSA-hgf8-39gv-g3f2 x_refsource_CONFIRM
- https://github.com/pallets/werkzeug/commit/4b833376a45c323a189cd11d2362bcffdb1c0c13 x_refsource_MISC
- https://github.com/pallets/werkzeug/releases/tag/3.1.4 x_refsource_MISC