wcmatch 13.0 Patch Fixes High-Severity ReDoS Flaw in Glob Pattern Matching

A high-severity regular expression denial of service (ReDoS) vulnerability, CVE-2026-141598, has been patched in version 13.0 of the Python globbing library wcmatch. The flaw, which affects versions prior to 13.0, allows attackers to exhaust CPU resources by supplying non-matching paths to patterns containing three or more globstar segments. The issue was discovered by two contributors and fixed by wrapping specific pattern segments in atomic groups to prevent exponential backtracking. While the vulnerability carries a CVSS score of 8.2, exploitation requires specific configuration conditions, including the enabling of GLOBSTAR mode, which is not active by default.
Key points
- CVE-2026-141598 affects wcmatch versions prior to 13.0, with the fix released on December 1, 2026.
- The vulnerability is a ReDoS issue caused by inefficient regular expression complexity in the _handle_star() function when processing multiple globstar segments.
- Attackers can trigger O(n^k) backtracking by providing a few kilobytes of non-matching path data, potentially consuming a CPU core for minutes.
- The flaw is rated 8.2 High under CVSS 4.0 and 5.9 Medium under CVSS 3.1, with high availability impact but no confidentiality or integrity risks.
- Exploitation requires the GLOBSTAR feature to be enabled, which is not the default configuration, and involves matching attacker-controlled paths against application-defined patterns.
Background
This vulnerability is a residual issue from an earlier advisory, GHSA-53pm-wgxf-c6qf, which addressed similar backtracking problems for single star patterns but left globstar segments unchanged. The root cause involves lazy repetition in globstar patterns that can consume any number of directories, leading to exponential computational complexity as path length increases. The fix in version 13.0 wraps consecutive globstar segments in atomic groups to ensure linear time complexity. This follows a trend of security patches in Python libraries, including recent fixes for Pydantic AI and Webmin vulnerabilities, highlighting ongoing efforts to address security flaws in widely used software components.
Why it matters
The vulnerability poses a risk to applications that use wcmatch to match user-controlled paths against glob patterns, particularly in environments where GLOBSTAR is enabled. Although the attack complexity is high and requires specific configuration, the potential for CPU exhaustion could lead to denial of service in critical systems. The fix ensures that pattern matching remains efficient, preventing attackers from exploiting the library's computational weaknesses. This underscores the importance of timely patching and careful configuration of security-sensitive features in software development.
What to watch
Developers using wcmatch should upgrade to version 13.0 or later to mitigate the ReDoS vulnerability. Organizations should review their use of GLOBSTAR in glob patterns and ensure that attacker-controlled paths are not matched against complex patterns. Monitoring for unusual CPU usage in systems using wcmatch can help detect potential exploitation attempts. Further research may reveal additional edge cases or related vulnerabilities in similar globbing libraries.
Want the full story? Read the original reporting
Read on CVEs | Zero Wire | Cloudflare Radar