Werkzeug safe_join() allows Windows special device names
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- Present
- Impact type
- —
- Confidentiality · integrity · availability
- None · None · Low
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA and GitHub.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| pallets | werkzeug | before 3.1.4 | 3.1.4 | Patch available | CNA |
| — | werkzeug (PyPI) | before 3.1.4 | 3.1.4 | Patch available | GHSA-hgf8-39gv-g3f2 |
- werkzeug Vendorpallets Affected before 3.1.4 Fixed in 3.1.4 Patch available CNA
- werkzeug (PyPI) Vendor— Affected before 3.1.4 Fixed in 3.1.4 Patch available GHSA-hgf8-39gv-g3f2
Remediation
- Fix · CNA werkzeug (pallets) Fixed in 3.1.4
- Fix · GHSA-hgf8-39gv-g3f2 werkzeug (PyPI) Fixed in 3.1.4 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2025-66221
- 2026-10-03 Alias added: GHSA-hgf8-39gv-g3f2
References
Advisory 2
More pallets Werkzeug vulnerabilities
- TI-2019-10671 In Pallets Werkzeug before 0.15.5, SharedDataMiddleware mishandles drive names (such as C:) in Windows pathnames. CVSS 3.1HIGH 7.5
- TI-2022-11856 Improper parsing of HTTP requests in Pallets Werkzeug v2.1.0 and below allows attackers… CVSS 3.1CRITICAL 9.8
- TI-2023-10880 Werkzeug may allow high resource usage when parsing multipart form data with many fields CVSS 3.1HIGH 7.5
- TI-2024-22527 Werkzeug's improper usage of a pathname and improper CSRF protection results in the remote command execution CVSS 3.1HIGH 7.5
- TI-2024-33234 Werkzeug possible resource exhaustion when parsing file data in forms CVSS 4.0MEDIUM 6.9
- TI-2023-24778 Uncontrolled resource consumption in pallets werkzeug CVSS 3.1HIGH 8.0
Sources
- CVE-2025-66221 · CVE Program
- CVE-2025-66221 · NVD
- FIRST EPSS
- GHSA-hgf8-39gv-g3f2 · GitHub Advisory Database · CC BY 4.0
- CVE-2025-66221 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences