CVE-2026-21860: CWE-67: Improper Handling of Windows Device Names in pallets werkzeug
Werkzeug is a comprehensive WSGI web application library. Prior to version 3.1.5, Werkzeug's safe_join function allows path segments with Windows device names that have file extensions or trailing spaces. On Windows, there are special device names such as CON, AUX, etc that are implicitly present and readable in every directory. Windows still accepts them with any file extension, such as CON.txt, or trailing spaces such as CON. This issue has been patched in version 3.1.5.
AI Analysis
Technical Summary
Werkzeug is a widely used WSGI web application library in Python environments. The vulnerability identified as CVE-2026-21860 (CWE-67) affects Werkzeug versions prior to 3.1.5 in its safe_join function, which is designed to securely concatenate file system paths. On Windows, certain device names such as CON, AUX, PRN, NUL, and others are reserved system devices that can be accessed implicitly in any directory. Windows also permits these device names to be used with file extensions or trailing spaces (e.g., CON.txt or CON ). Werkzeug's safe_join function did not correctly handle these special device names with extensions or trailing spaces, allowing crafted path segments to bypass intended path validation and normalization. This improper handling could enable an attacker to reference or manipulate special device files, potentially leading to unauthorized file access, denial of service, or other impacts depending on application logic. The vulnerability is exploitable remotely over the network without requiring authentication or user interaction, as indicated by the CVSS vector (AV:N/AC:L/PR:N/UI:N). The impact is limited to availability (VA:L) with no confidentiality or integrity impact reported. The issue was patched in Werkzeug version 3.1.5, which properly sanitizes and rejects such Windows device name path segments. No public exploits have been observed, but the vulnerability poses a risk for Windows-hosted web applications using vulnerable Werkzeug versions.
Potential Impact
For European organizations, this vulnerability primarily affects web applications running on Windows servers that utilize Werkzeug versions prior to 3.1.5. Exploitation could allow attackers to bypass path validation mechanisms, potentially leading to unauthorized access or manipulation of special device files. This can result in denial of service conditions or unintended behavior in web applications, impacting availability. While confidentiality and integrity impacts are not explicitly noted, the ability to manipulate file paths could be leveraged in complex attack chains. Organizations relying on Werkzeug in Windows environments, especially those hosting critical web services, may face service disruptions or exploitation attempts. The medium severity rating reflects a moderate risk, but the absence of known exploits reduces immediate threat. However, given the common use of Werkzeug in Python web frameworks and the prevalence of Windows servers in enterprise environments, the vulnerability warrants prompt remediation to prevent potential exploitation.
Mitigation Recommendations
1. Upgrade Werkzeug to version 3.1.5 or later immediately to apply the official patch that correctly handles Windows device names in path segments. 2. Audit all Python web applications running on Windows servers to identify usage of Werkzeug and verify versions. 3. Implement additional input validation and sanitization on file path parameters at the application level to detect and reject suspicious device name patterns (e.g., CON, AUX, PRN) with extensions or trailing spaces. 4. Employ runtime application self-protection (RASP) or web application firewalls (WAFs) configured to detect and block requests containing Windows device names in path inputs. 5. Monitor application logs for unusual file access attempts involving reserved device names. 6. Educate development teams about Windows-specific path handling quirks and the importance of secure path joining functions. 7. Consider isolating Windows-hosted web applications in hardened environments with strict access controls to limit impact if exploitation occurs.
Affected Countries
Germany, France, United Kingdom, Netherlands, Italy, Spain, Poland, Sweden
CVE-2026-21860: 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.5, Werkzeug's safe_join function allows path segments with Windows device names that have file extensions or trailing spaces. On Windows, there are special device names such as CON, AUX, etc that are implicitly present and readable in every directory. Windows still accepts them with any file extension, such as CON.txt, or trailing spaces such as CON. This issue has been patched in version 3.1.5.
AI-Powered Analysis
Technical Analysis
Werkzeug is a widely used WSGI web application library in Python environments. The vulnerability identified as CVE-2026-21860 (CWE-67) affects Werkzeug versions prior to 3.1.5 in its safe_join function, which is designed to securely concatenate file system paths. On Windows, certain device names such as CON, AUX, PRN, NUL, and others are reserved system devices that can be accessed implicitly in any directory. Windows also permits these device names to be used with file extensions or trailing spaces (e.g., CON.txt or CON ). Werkzeug's safe_join function did not correctly handle these special device names with extensions or trailing spaces, allowing crafted path segments to bypass intended path validation and normalization. This improper handling could enable an attacker to reference or manipulate special device files, potentially leading to unauthorized file access, denial of service, or other impacts depending on application logic. The vulnerability is exploitable remotely over the network without requiring authentication or user interaction, as indicated by the CVSS vector (AV:N/AC:L/PR:N/UI:N). The impact is limited to availability (VA:L) with no confidentiality or integrity impact reported. The issue was patched in Werkzeug version 3.1.5, which properly sanitizes and rejects such Windows device name path segments. No public exploits have been observed, but the vulnerability poses a risk for Windows-hosted web applications using vulnerable Werkzeug versions.
Potential Impact
For European organizations, this vulnerability primarily affects web applications running on Windows servers that utilize Werkzeug versions prior to 3.1.5. Exploitation could allow attackers to bypass path validation mechanisms, potentially leading to unauthorized access or manipulation of special device files. This can result in denial of service conditions or unintended behavior in web applications, impacting availability. While confidentiality and integrity impacts are not explicitly noted, the ability to manipulate file paths could be leveraged in complex attack chains. Organizations relying on Werkzeug in Windows environments, especially those hosting critical web services, may face service disruptions or exploitation attempts. The medium severity rating reflects a moderate risk, but the absence of known exploits reduces immediate threat. However, given the common use of Werkzeug in Python web frameworks and the prevalence of Windows servers in enterprise environments, the vulnerability warrants prompt remediation to prevent potential exploitation.
Mitigation Recommendations
1. Upgrade Werkzeug to version 3.1.5 or later immediately to apply the official patch that correctly handles Windows device names in path segments. 2. Audit all Python web applications running on Windows servers to identify usage of Werkzeug and verify versions. 3. Implement additional input validation and sanitization on file path parameters at the application level to detect and reject suspicious device name patterns (e.g., CON, AUX, PRN) with extensions or trailing spaces. 4. Employ runtime application self-protection (RASP) or web application firewalls (WAFs) configured to detect and block requests containing Windows device names in path inputs. 5. Monitor application logs for unusual file access attempts involving reserved device names. 6. Educate development teams about Windows-specific path handling quirks and the importance of secure path joining functions. 7. Consider isolating Windows-hosted web applications in hardened environments with strict access controls to limit impact if exploitation occurs.
Affected Countries
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-01-05T16:44:16.367Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 695ffd5601d35e5d0c85d733
Added to database: 1/8/2026, 6:54:14 PM
Last enriched: 1/8/2026, 7:09:28 PM
Last updated: 1/9/2026, 12:13:57 PM
Views: 47
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
377,000 Impacted by Data Breach at Texas Gas Station Firm
MediumCVE-2025-66051: CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in Vivotek IP7137
MediumCVE-2025-66050: CWE-1393 Use of Default Password in Vivotek IP7137
CriticalCVE-2025-66049: CWE-306 Missing Authentication for Critical Function in Vivotek IP7137
HighCVE-2026-22081: CWE-1004 - Sensitive Cookie Without HttpOnly Flag in Tenda 300Mbps Wireless Router F3 and N300 Easy Setup Router
HighActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.