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

- Severity: Medium 6.3 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.55%, higher than 47% of CVEs (2026-12-01)
- Published: 2025-11-29T02:28:34.524Z
- Modified: 2026-10-07T20:10:01.970Z
- Also known as: GHSA-hgf8-39gv-g3f2, PYSEC-2026-2046
- Weaknesses: CWE-67
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- pallets werkzeug: < 3.1.4
- werkzeug (PyPI): before 3.1.4
- palletsprojects werkzeug: before 3.1.4

## Every score

- GitHub_M: CVSS:4.0 6.3 Medium `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`
- GitHub: CVSS:4.0 Medium `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`
- NVD: CVSS:3.1 5.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- PyPA Advisory Database: CVSS:4.0 `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> (vendor-advisory, web)
- <https://github.com/pallets/werkzeug/commit/4b833376a45c323a189cd11d2362bcffdb1c0c13> (patch, web)
- <https://github.com/pallets/werkzeug/releases/tag/3.1.4> (release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-66221> (advisory)
- <https://github.com/pallets/werkzeug> (package)
- <https://pypi.org/project/werkzeug> (package)
- <https://github.com/advisories/GHSA-hgf8-39gv-g3f2> (advisory)

## Sources

- CVE List: [CVE-2025-66221](https://www.cve.org/CVERecord?id=CVE-2025-66221), CVE Terms of Use, modified 2025-12-01
- GitHub Advisory Database: [GHSA-hgf8-39gv-g3f2](https://github.com/advisories/GHSA-hgf8-39gv-g3f2), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2025-66221](https://nvd.nist.gov/vuln/detail/CVE-2025-66221), Public domain, modified 2026-10-07
- PyPA Advisory Database: [PYSEC-2026-2046](https://osv.dev/vulnerability/PYSEC-2026-2046), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2025-66221 · Whole record: https://cve.day/CVE-2025-66221.json · Rebuilt by cve.day 2026-11-25T22:59:08.093Z
