Oct 6, 2026·7 min read·68 visits
A validation bypass in Werkzeug's safe_join utility on Windows systems allows attackers to bypass reserved device checks using empty NTFS Alternate Data Stream markers, causing server worker threads to block indefinitely and triggering a Denial of Service.
CVE-2026-102598 is a security bypass and Denial of Service (DoS) vulnerability in the Werkzeug WSGI web application library. In versions prior to 3.1.9, the library's safe_join function fails to sanitize Windows reserved device names containing an empty NTFS Alternate Data Stream (ADS) marker (such as NUL:). This allows remote, unauthenticated attackers to trigger indefinite thread-blocking operations on Windows hosts, resulting in application-wide resource exhaustion.
Werkzeug is a comprehensive WSGI web application library for Python, widely utilized as the underlying foundation for frameworks such as Flask. In deployment environments running on Microsoft Windows with an NTFS filesystem, the library exposes a path-traversal and file-handling attack surface through its sanitization utilities. Specifically, the utility function safe_join is designed to ensure that untrusted user-supplied file paths are constrained within a target base directory.\n\nA flaw in the validation logic of safe_join allows attackers to bypass checks designed to restrict access to reserved Windows device names. By appending an empty NTFS Alternate Data Stream (ADS) marker, such as NUL:, an attacker can circumvent the blocklist of legacy DOS device names. This bypass allows the path resolution to succeed, leading to dangerous downstream file-system operations on reserved physical hardware names.\n\nThe primary security consequence of this validation bypass is a remote, unauthenticated Denial of Service (DoS). When a downstream component attempts to open and read from the incorrectly resolved device path, the operating system-level file handler blocks execution indefinitely. This resource exhaustion quickly consumes available server worker threads, rendering the application unavailable to legitimate network traffic.
The root cause of this vulnerability lies in the improper handling of Windows reserved device names, classified under CWE-67. Modern Windows operating systems retain compatibility with legacy MS-DOS device names, including NUL, CON, PRN, AUX, and serial or parallel port identifiers. When applications open these identifiers as file paths, the operating system translates the requests to physical hardware streams or system devices rather than typical storage directories.\n\nTo prevent directory escapes and improper device access, Werkzeug maintains a blocklist of forbidden identifiers inside _windows_device_files and validates path components using safe_join. Prior to version 3.1.9, the validation mechanism checked path segments against this blocklist by partitioning strings around the period (.) character. The logic expected that any file extension or suffix would be isolated, leaving the base name to be evaluated against the restricted device list.\n\nOn NTFS filesystems, files can contain Alternate Data Streams (ADS), defined by a colon (:) separator in the format filename:streamname:streamtype. An empty ADS marker can be appended directly to a device name, resulting in a string such as NUL:. When Werkzeug processed this segment, the partitioning logic looked for a period but found none. Consequently, the string `
Evaluating the vulnerable code path demonstrates how the parser missed the Alternate Data Stream marker. In Werkzeug versions prior to 3.1.9, the check evaluated each directory segment in part.split("/") against the legacy device blocklist using a simple partition. The loop evaluated p.partition(".")[0].strip().upper(), which fails when a colon is present instead of a period.\n\npython\n# Vulnerable implementation in Werkzeug < 3.1.9\nos.name == "nt" and any(\n # Partitions only on period, missing the colon separator\n p.partition(".")[0].strip().upper() in _windows_device_files\n for p in part.split("/")\n)\n\n\nThe patch introduced in version 3.1.9 resolves this validation gap by adding a primary partition step targeting the NTFS stream separator. By partitioning the segment on the colon (:) first, the logic effectively strips any Alternate Data Stream identifiers prior to performing the check against the period (.) character. This ensures that the base device name is isolated and properly validated against the blocklist.\n\npython\n# Patched implementation in Werkzeug 3.1.9\nos.name == "nt" and any(\n # First partitions on colon to strip ADS, then on period\n p.partition(":")[0].partition(".")[0].strip().upper()\n in _windows_device_files\n for p in part.split("/")\n)\n\n\nThis corrective code completely closes this bypass vector by ensuring that strings like NUL: are truncated to NUL before the membership test. This fix is robust against variants using multiple colons or combining colons and periods in unexpected sequences. The modification prevents downstream system calls from interacting with the underlying legacy DOS device drivers under any circumstances.
An attack exploiting CVE-2026-102598 requires specific environmental conditions to trigger successfully. First, the target web application must run on a Windows server utilizing an NTFS filesystem. Second, the application must expose an endpoint that serves static files, downloads, or media resources utilizing Werkzeug's send_from_directory helper or directly invoking safe_join with user-controlled input.\n\nAn unauthenticated attacker begins exploitation by sending a crafted HTTP GET request targeting the file-serving endpoint. The request includes a parameter containing the legacy device name appended with an empty Alternate Data Stream marker, such as ?file=NUL:. Because safe_join fails to flag this string as restricted, it returns the fully resolved path, which is then passed to Python's native open() function.\n\nWhen Windows processes the file-open API call for the resolved path C:\\app\\static\\NUL:, it strips the trailing colon and redirects the operation to the system null device. A read operation on this physical device does not return a typical EOF immediately under these conditions but instead blocks the calling execution thread. Because web application servers rely on a finite pool of worker threads or processes, sequentially submitting these requests quickly exhausts all available threads, resulting in a complete application hang and denial of service.
The security impact of CVE-2026-102598 is classified as a localized Denial of Service (DoS) with a CVSS v4.0 score of 6.3. The vulnerability does not allow for remote code execution, privilege escalation, or unauthorized data disclosure. Confidentiality and integrity remain unaffected because the attacker cannot read files outside the directory or write malicious data to the system.\n\nHowever, the availability impact is significant for applications running on affected Windows systems. Each successful exploit payload blocks a single worker thread permanently. In multi-threaded WSGI containers, sending a small number of concurrent requests matching the pool size will completely freeze the application, preventing legitimate users from accessing the system.\n\nBecause Werkzeug is a foundational package for thousands of web applications, the exposure profile is broad, though mitigated by the requirement for a Windows/NTFS environment. Many production environments run on Linux containers, which are inherently immune to this specific MS-DOS device path behavior. For Windows-based enterprise applications, the risk is elevated because the exploit is exceptionally simple to execute and leaves minimal trace in standard web application logs prior to the thread crash.
The primary remediation path is upgrading the Werkzeug package to version 3.1.9 or later. This upgrade addresses the vulnerability at the library level, ensuring that all dependent frameworks like Flask are protected without requiring application-level code modifications. Administrators should update their dependencies using package managers and redeploy their application containers.\n\nIn environments where immediate upgrading is not possible, system administrators can apply temporary workarounds. One operational mitigation is to implement an application-level input validation filter. This filter should inspect incoming path parameters and explicitly reject any requests containing colons (:) or matching known Windows reserved device names prior to forwarding the input to Werkzeug's file-handling functions.\n\nAdditionally, deploying Web Application Firewall (WAF) rules or configuring reverse proxies (such as IIS or Nginx) to block URI paths containing colons in query parameters or URL segments can prevent exploit payloads from reaching the application server. For long-term resilience, security teams should consider migrating Python-based web applications to Linux-based container environments, which completely eliminates legacy Windows OS-specific path vulnerabilities.
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| Product | Affected Versions | Fixed Version |
|---|---|---|
Werkzeug Pallets | < 3.1.9 | 3.1.9 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-67 |
| Attack Vector | Network (AV:N) |
| CVSS v4.0 | 6.3 (Medium) |
| EPSS Score | 0.00368 (28.41% Percentile) |
| Impact | Denial of Service (DoS) via thread exhaustion |
| Exploit Status | PoC / Public details available |
| CISA KEV Status | Not listed |
The software does not properly sanitize or validate user-supplied input that represents Windows reserved device names, enabling unexpected execution paths or system degradation when these identifiers resolve to physical hardware or system devices instead of typical files.
CVE-2026-126295 (also tracked as GHSA-fg9w-wfp5-j933) is a path confinement bypass vulnerability in the Natural Language Toolkit (NLTK) affecting versions 3.10.0 prior to 3.10.4. The flaw resides in nltk/parse/bllip.py within the BllipParser class and its factory method BllipParser.from_unified_model_dir(). Unlike sibling tool wrappers in NLTK that enforce data-root confinement via the nltk.pathsec module, BllipParser passes caller-supplied filesystem paths directly into the third-party bllipparser native C extension without validation. When an application passes untrusted input as model paths or directories to BllipParser, an attacker can force the native extension to open arbitrary files on the local filesystem. This leads to information disclosure through parser diagnostic oracles, local model tampering via shared directories, and denial of service by hanging worker threads on blocking special files (such as FIFOs or device nodes) or exhausting memory via oversized files.
CVE-2026-126300 (GHSA-ffr9-mgrr-wcvr) is an inefficient algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) Python library affecting versions 3.2.5 prior to 3.10.4. The flaw resides in the quote-restoration routine of TreebankWordTokenizer.span_tokenize and NLTKWordTokenizer.span_tokenize, where repeated calls to list.pop(0) over matched quote tokens introduce quadratic O(n^2) time complexity. An unauthenticated remote attacker who supplies input containing long sequences of double-quote characters can exhaust CPU resources and degrade service availability.
The Natural Language Toolkit (NLTK) versions 3.6 through 3.10.3 contain an algorithmic complexity vulnerability in the LegalitySyllableTokenizer.tokenize method. When processing tokens composed of continuous runs of vowels, an unguarded string reversal and set membership lookup loop executes in quadratic time relative to the input token length. Remote attackers capable of submitting arbitrary text to applications utilizing this tokenizer can trigger sustained single-core CPU exhaustion and application-level denial of service.
CVE-2026-126304 is a symlink path traversal vulnerability (CWE-59) in the Natural Language Toolkit (NLTK) versions 3.10.0 prior to 3.10.4. The YCOECorpusReader class constructs internal sub-readers for the 'psd' and 'pos' subdirectories using FileSystemPathPointer.join(), which relies exclusively on lexical string-prefix validation rather than canonical path resolution. An attacker who supplies a crafted YCOE corpus containing symbolic links in place of the 'psd' or 'pos' subdirectories can bypass directory confinement and read arbitrary files from sibling corpora or sensitive directories within the NLTK data sandbox.
CVE-2026-128077 (GHSA-r99w-jh2x-3mg9) is an authorization bypass and interpretation conflict vulnerability affecting Nuxt and its underlying @nuxt/nitro-server package in versions 4.6.0 through 4.6.3. When an incoming HTTP request path begins with a double forward slash (e.g., //x/admin), the WHATWG URL parser within the Nuxt server-side page renderer interprets the initial segment as a network host/authority and resolves the remaining path (/admin) against the application's page router. Because Nitro server middleware, route-scoped serverHandlers, and Nitro routeRules evaluate the unparsed request path (//x/admin), path-based access controls, redirects, and security header policies configured for /admin fail to match and are bypassed.
Prior to version 2.10.2, the sqlite3-ruby gem explicitly cast 64-bit Ruby string lengths (long) to 32-bit signed integers (int) when invoking the underlying SQLite C API. On 64-bit platforms, providing a string of 4 GiB (2^32 bytes) or larger causes integer truncation, instructing SQLite to process only a prefix of the string. This flaw affects SQL query preparation, bound parameter values, and return values from custom Ruby-defined SQL functions and aggregates, allowing trailing SQL clauses such as WHERE restrictions to be silently dropped under specific conditions.