CVE-2025-66221: CWE-67: Improper Handling of Windows Device Names in pallets werkzeug
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.
AI Analysis
Technical Summary
Werkzeug is a widely used WSGI web application library in Python environments. The vulnerability CVE-2025-66221 stems from the safe_join function's failure to properly handle Windows device names such as CON, AUX, NUL, PRN, and others. These device names are special reserved names in Windows that exist implicitly in every directory and can be accessed like files. The send_from_directory function in Werkzeug relies on safe_join to securely serve files from user-specified paths under a given directory. However, when running on Windows, if a request path ends with one of these special device names, safe_join allows the path to resolve successfully, and the file handle is opened. Attempting to read from this handle causes the reading operation to hang indefinitely because these device names do not correspond to normal files but special devices. This results in a denial of service (DoS) condition where the web server process or thread is blocked, potentially exhausting resources or causing application unresponsiveness. The vulnerability does not require authentication or user interaction and can be triggered remotely by sending crafted HTTP requests. The issue was addressed in Werkzeug version 3.1.4 by adding checks to prevent Windows device names from being accepted in path segments, thereby avoiding the hang condition. No known exploits have been reported in the wild as of the publication date. The CVSS 4.0 base score is 6.3 (medium severity), reflecting network attack vector, low complexity, no privileges required, no user interaction, and limited impact on availability (denial of service).
Potential Impact
For European organizations, this vulnerability primarily poses a risk of denial of service in Python web applications using Werkzeug on Windows servers. Applications that serve files dynamically using send_from_directory are susceptible to hanging when processing requests with Windows device names in the path. This can lead to application unavailability, degraded user experience, and potential operational disruptions. Organizations relying on Windows-based hosting environments for Python web services, including internal tools, customer-facing portals, or APIs, may experience service interruptions. While the vulnerability does not directly expose sensitive data or allow code execution, the denial of service impact can affect business continuity and service level agreements. In sectors such as finance, healthcare, and critical infrastructure within Europe, where uptime and reliability are paramount, this vulnerability could have significant operational consequences if exploited. Additionally, incident response and recovery efforts may incur costs and resource allocation. The lack of known exploits reduces immediate risk, but the ease of triggering the hang condition remotely warrants proactive mitigation.
Mitigation Recommendations
European organizations should immediately upgrade Werkzeug to version 3.1.4 or later to apply the official patch that prevents Windows device names in path segments. For environments where immediate upgrade is not feasible, implement input validation or sanitization at the application or web server level to reject or normalize requests containing Windows device names such as CON, AUX, NUL, PRN, COM1-COM9, and LPT1-LPT9 in file paths. Monitoring and logging HTTP requests for suspicious path patterns can help detect attempted exploitation. Employ rate limiting and request filtering to mitigate potential denial of service attempts. Consider isolating Windows-based Python web applications in containerized or sandboxed environments to limit impact if a hang occurs. Regularly review and update dependencies to incorporate security patches promptly. Conduct testing in staging environments to verify that patched versions or mitigations effectively prevent the hang condition. Finally, educate development and operations teams about this specific vulnerability to ensure awareness and timely response.
Affected Countries
Germany, France, United Kingdom, Italy, Spain, Netherlands, Poland, Belgium, Sweden, Switzerland
CVE-2025-66221: CWE-67: Improper Handling of Windows Device Names in pallets werkzeug
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.
AI-Powered Analysis
Technical Analysis
Werkzeug is a widely used WSGI web application library in Python environments. The vulnerability CVE-2025-66221 stems from the safe_join function's failure to properly handle Windows device names such as CON, AUX, NUL, PRN, and others. These device names are special reserved names in Windows that exist implicitly in every directory and can be accessed like files. The send_from_directory function in Werkzeug relies on safe_join to securely serve files from user-specified paths under a given directory. However, when running on Windows, if a request path ends with one of these special device names, safe_join allows the path to resolve successfully, and the file handle is opened. Attempting to read from this handle causes the reading operation to hang indefinitely because these device names do not correspond to normal files but special devices. This results in a denial of service (DoS) condition where the web server process or thread is blocked, potentially exhausting resources or causing application unresponsiveness. The vulnerability does not require authentication or user interaction and can be triggered remotely by sending crafted HTTP requests. The issue was addressed in Werkzeug version 3.1.4 by adding checks to prevent Windows device names from being accepted in path segments, thereby avoiding the hang condition. No known exploits have been reported in the wild as of the publication date. The CVSS 4.0 base score is 6.3 (medium severity), reflecting network attack vector, low complexity, no privileges required, no user interaction, and limited impact on availability (denial of service).
Potential Impact
For European organizations, this vulnerability primarily poses a risk of denial of service in Python web applications using Werkzeug on Windows servers. Applications that serve files dynamically using send_from_directory are susceptible to hanging when processing requests with Windows device names in the path. This can lead to application unavailability, degraded user experience, and potential operational disruptions. Organizations relying on Windows-based hosting environments for Python web services, including internal tools, customer-facing portals, or APIs, may experience service interruptions. While the vulnerability does not directly expose sensitive data or allow code execution, the denial of service impact can affect business continuity and service level agreements. In sectors such as finance, healthcare, and critical infrastructure within Europe, where uptime and reliability are paramount, this vulnerability could have significant operational consequences if exploited. Additionally, incident response and recovery efforts may incur costs and resource allocation. The lack of known exploits reduces immediate risk, but the ease of triggering the hang condition remotely warrants proactive mitigation.
Mitigation Recommendations
European organizations should immediately upgrade Werkzeug to version 3.1.4 or later to apply the official patch that prevents Windows device names in path segments. For environments where immediate upgrade is not feasible, implement input validation or sanitization at the application or web server level to reject or normalize requests containing Windows device names such as CON, AUX, NUL, PRN, COM1-COM9, and LPT1-LPT9 in file paths. Monitoring and logging HTTP requests for suspicious path patterns can help detect attempted exploitation. Employ rate limiting and request filtering to mitigate potential denial of service attempts. Consider isolating Windows-based Python web applications in containerized or sandboxed environments to limit impact if a hang occurs. Regularly review and update dependencies to incorporate security patches promptly. Conduct testing in staging environments to verify that patched versions or mitigations effectively prevent the hang condition. Finally, educate development and operations teams about this specific vulnerability to ensure awareness and timely response.
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2025-11-24T23:01:29.679Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 692a637a2a13ea799fe08f2a
Added to database: 11/29/2025, 3:07:38 AM
Last enriched: 11/29/2025, 3:22:44 AM
Last updated: 11/29/2025, 11:11:31 AM
Views: 9
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2025-6666: Use of Hard-coded Cryptographic Key in motogadget mo.lock Ignition Lock
LowCVE-2025-65892: n/a
UnknownCVE-2025-65540: n/a
UnknownCVE-2025-53939: CWE-20: Improper Input Validation in kiteworks security-advisories
MediumCVE-2025-53900: CWE-267: Privilege Defined With Unsafe Actions in kiteworks security-advisories
MediumActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.