CVE-2026-132276
CPU-intensive regex backtracking in wcmatch wildcard matching (pre‑11.2).
- CVSS 5.9
- CWE-1333
- Resource Management
- Remote
wcmatch is a Python library for wildcard file-name matching. Prior to 11.2, under the default flags, matching a non-matching attacker-controlled name against an application-supplied pattern containing several star wildcards separated by literals makes the lazy .? and [^/]? segments, including _STAR and _PATH_STAR emitted by _handle_star() in wcmatch/_wcparse.py, backtrack across possible splits, so a single comparison can consume prolonged CPU time. The pattern remains a developer-controlled constant and only the name is attacker-controlled; affected paths include fnmatch.fnmatch(), glob.globmatch(), and filesystem glob scans where another user can create names, without enabling extglob or any non-default flag. This issue is fixed in 11.2.
- CWE
- CWE-1333
- CVSS base score
- 5.9
- Published
- 2026-11-20
- OWASP
- A04 Insecure Design
- Orthogonal defect classification
- Timing/Serialization
- Code defect classification
- Timing Issues
- Category
- Resource Management
- Subcategory
- Resource Exhaustion
- Accessibility scope
- Remote
- Impact
- Denial of Service (DoS)
- Affected component
- wcmatch
- Fixed by upgrading
- Yes
Solution
Upgrade wcmatch to version 11.2 or newer.
Vulnerable code sample
import wcmatch.fnmatch as fnmatch
PATTERN = "src/*/data/*.txt"
def is_allowed_path(user_path: str) -> bool:
# VULNERABLE: catastrophic backtracking on complex patterns
return fnmatch.fnmatch(user_path, PATTERN)
def process_path(user_path: str):
if is_allowed_path(user_path):
# placeholder for safe handling
passPatched code sample
import wcmatch.fnmatch as fnmatch
PATTERN = "src/*/data/*.txt"
def is_allowed_path(user_path: str) -> bool:
# FIX: limit backtracking by disabling lazy segments
return fnmatch.fnmatch(user_path, PATTERN, flags=fnmatch.F)
def process_path(user_path: str):
if is_allowed_path(user_path):
# placeholder for safe handling
passPublished fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- Merge commit from fork (facelessuser/wcmatch)
hatch_build.py · CustomMetadataHook.update,wcmatch/_wcparse.py,wcmatch/_wcparse.py · WcParse.parse_extend,wcmatch/_wcparse.py · WcParse.root,wcmatch/_wcparse.py · WcParse._handle_star,wcmatch/_wcparse.py · WcParse.__init__
Cite this entry
@misc{vaitp:cve2026132276,
title = {{CPU-intensive regex backtracking in wcmatch wildcard matching (pre‑11.2).}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-132276},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-132276/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
