{"vuln_id":"CVE-2026-132276","aliases":["GHSA-53pm-wgxf-c6qf","GHSA-84v8-qmgq-9g88"],"description":"wcmatch: Polynomial-time ReDoS when matching untrusted names against multi-star patterns (default flags)","published_at":"2026-11-20T17:18:12.723000Z","modified_at":"2026-11-21T00:00:04.019297Z","first_seen_at":"2026-11-21T19:15:19.243961Z","severity":"medium","severity_source":"nvd","cvss_score":5.9,"cvss_vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","cwe":["CWE-1333"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00881,"epss_percentile":0.6002,"nvd_status":"Received","enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-132276"},"matched_alias":null,"items":[{"id":10648,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-53pm-wgxf-c6qf: wcmatch: Polynomial-time ReDoS when matching untrusted names against multi-star patterns (default flags)","summary":"wcmatch: Polynomial-time ReDoS when matching untrusted names against multi-star patterns (default flags)\n\n# Summary\n\nWith 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.\n\nThis is different from GHSA-84v8-qmgq-9g88: that advisory covers extglob patterns, while this case needs no flags and no attacker-controlled pattern.\n\n# Details\n\nEvery `*` is translated to a lazy `.*?` (`_STAR`, `wcmatch/_wcparse.py:212`; `_PATH_STAR` `[^/]*?`, `:218`), which is emitted in `_handle_star` (`:1405-1424`):\n\n```text\n*_*_*_*_*.csv  ->  ^(?s:(?=.)(?![.]).*?_.*?_.*?_.*?_.*?\\.csv)$\n```\n\nWhen 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.\n\n# PoC\n\n```python\nimport time, fnmatch as std\nfrom wcmatch import fnmatch, glob\n\nfor pat, n in [('*_*_*_*.csv', 255), ('*_*_*_*.csv', 400), ('*_*_*_*_*.csv', 150),\n               ('*_*_*_*_*.csv', 200), ('*_*_*_*_*.csv', 255)]:\n    name = '_' * n\n    t = time.perf_counter(); fnmatch.fnmatch(name, pat); w = time.perf_counter() - t\n    t = time.perf_counter(); std.fnmatchcase(name, pat); s = time.perf_counter() - t\n    print(f'{pat:15} len={n}  wcmatch={w:.3f}s  stdlib={s:.5f}s')\n\nt = time.perf_counter(); glob.globmatch('uploads/' + '_' * 255, 'uploads/*_*_*_*_*.csv')\nprint(f'globmatch {time.perf_counter() - t:.2f}s')\n```\n\nwcmatch 11.1, CPython 3.13, macOS:\n\n```text\n*_*_*_*.csv     len=255  wcmatch=1.412s   stdlib=0.00001s\n*_*_*_*.csv     len=400  wcmatch=8.599s   stdlib=0.00004s\n*_*_*_*_*.csv   len=150  wcmatch=5.333s   stdlib=0.00003s\n*_*_*_*_*.csv   len=200  wcmatch=22.415s  stdlib=0.00007s\n*_*_*_*_*.csv   len=255  wcmatch=72.732s  stdlib=0.00047s\nglobmatch 85.75s\n```\n\n`glob.glob('*_*_*_*.csv', root_dir=d)` on a real directory that contains one file named `'_' * 255` takes 1.7 s.\n\n# Impact\n\nApplications that match untrusted names against multi-star patterns can be blocked on a single CPU core for minutes per name. Examples: upload handlers, archive or object-store key filters, and `glob`/`WcMatch` scans of directories where other users can create files. No authentication is needed.\n\n# Fix\n\nEmit every star segment except the last one as an atomic group, as the standard library does. On Python 3.11 and later use `(?>.*?_)`; on 3.10 use the lookahead/backreference form from `fnmatch._join_translated_parts`. For example:\n\n```text\n^(?s:(?=.)(?![.])(?>.*?_)(?>.*?_)(?>.*?_)(?>.*?_).*?\\.csv)$\n```\n\nThis rejects the 255-byte name in under 1 ms. On my spot-check inputs it gives the same results as the current regex. The same change applies\n\nAffected: PyPI:wcmatch\n\nFixed in: 11.2\n\nReferences:\nhttps://github.com/facelessuser/wcmatch/security/advisories/GHSA-53pm-wgxf-c6qf\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-132276\nhttps://github.com/facelessuser/wcmatch/commit/83491aadde57780330f993620083e979f645c80c\nhttps://github.com/facelessuser/wcmatch\nhttps://github.com/facelessuser/wcmatch/releases/tag/11.2","url":"https://osv.dev/vulnerability/GHSA-53pm-wgxf-c6qf","published_at":"2026-11-20T23:49:18Z","updated_at":"2026-11-21T00:00:04.019297Z","fetched_at":"2026-11-21T19:15:55.946074Z","severity":"medium","cvss_score":5.9,"epss":0.00881,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"wcmatch","vuln_id":"CVE-2026-132276","vuln_ids":["CVE-2026-132276","GHSA-53PM-WGXF-C6QF","GHSA-84V8-QMGQ-9G88"],"tags":["osv","pypi","fix-available"],"cluster_id":1978,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10648","html":"https://vulnwatch.ve1ve2.com/item/10648"}},{"id":2281,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-53pm-wgxf-c6qf / CVE-2026-132276: wcmatch: Polynomial-time ReDoS when matching untrusted names against multi-star patterns (default flags)","summary":"wcmatch: Polynomial-time ReDoS when matching untrusted names against multi-star patterns (default flags)\n\n# Summary\n\nWith 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.\n\nThis is different from GHSA-84v8-qmgq-9g88: that advisory covers extglob patterns, while this case needs no flags and no attacker-controlled pattern.\n\n# Details\n\nEvery `*` is translated to a lazy `.*?` (`_STAR`, `wcmatch/_wcparse.py:212`; `_PATH_STAR` `[^/]*?`, `:218`), which is emitted in `_handle_star` (`:1405-1424`):\n\n```text\n*_*_*_*_*.csv  ->  ^(?s:(?=.)(?![.]).*?_.*?_.*?_.*?_.*?\\.csv)$\n```\n\nWhen 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.\n\n# PoC\n\n```python\nimport time, fnmatch as std\nfrom wcmatch import fnmatch, glob\n\nfor pat, n in [('*_*_*_*.csv', 255), ('*_*_*_*.csv', 400), ('*_*_*_*_*.csv', 150),\n               ('*_*_*_*_*.csv', 200), ('*_*_*_*_*.csv', 255)]:\n    name = '_' * n\n    t = time.perf_counter(); fnmatch.fnmatch(name, pat); w = time.perf_counter() - t\n    t = time.perf_counter(); std.fnmatchcase(name, pat); s = time.perf_counter() - t\n    print(f'{pat:15} len={n}  wcmatch={w:.3f}s  stdlib={s:.5f}s')\n\nt = time.perf_counter(); glob.globmatch('uploads/' + '_' * 255, 'uploads/*_*_*_*_*.csv')\nprint(f'globmatch {time.perf_counter() - t:.2f}s')\n```\n\nwcmatch 11.1, CPython 3.13, macOS:\n\n```text\n*_*_*_*.csv     len=255  wcmatch=1.412s   stdlib=0.00001s\n*_*_*_*.csv     len=400  wcmatch=8.599s   stdlib=0.00004s\n*_*_*_*_*.csv   len=150  wcmatch=5.333s   stdlib=0.00003s\n*_*_*_*_*.csv   len=200  wcmatch=22.415s  stdlib=0.00007s\n*_*_*_*_*.csv   len=255  wcmatch=72.732s  stdlib=0.00047s\nglobmatch 85.75s\n```\n\n`glob.glob('*_*_*_*.csv', root_dir=d)` on a real directory that contains one file named `'_' * 255` takes 1.7 s.\n\n# Impact\n\nApplications that match untrusted names against multi-star patterns can be blocked on a single CPU core for minutes per name. Examples: upload handlers, archive or object-store key filters, and `glob`/`WcMatch` scans of directories where other users can create files. No authentication is needed.\n\n# Fix\n\nEmit every star segment except the last one as an atomic group, as the standard library does. On Python 3.11 and later use `(?>.*?_)`; on 3.10 use the lookahead/backreference form from `fnmatch._join_translated_parts`. For example:\n\n```text\n^(?s:(?=.)(?![.])(?>.*?_)(?>.*?_)(?>.*?_)(?>.*?_).*?\\.csv)$\n```\n\nThis rejects the 255-byte name in under 1 ms. On my spot-check inputs it gives the same results as the current regex. The same change applies\n\nAffected packages: pip:wcmatch\nPatched: wcmatch 11.2","url":"https://github.com/advisories/GHSA-53pm-wgxf-c6qf","published_at":"2026-11-20T23:49:18Z","updated_at":"2026-11-20T23:49:19Z","fetched_at":"2026-11-21T19:15:18.416718Z","severity":"medium","cvss_score":5.9,"epss":0.00881,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"wcmatch","vuln_id":"CVE-2026-132276","vuln_ids":["CVE-2026-132276","GHSA-53PM-WGXF-C6QF","GHSA-84V8-QMGQ-9G88"],"tags":["ghsa","pip","CWE-1333"],"cluster_id":1978,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2281","html":"https://vulnwatch.ve1ve2.com/item/2281"}},{"id":9919,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-132276: 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 a…","summary":"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.\n\nReferences:\nhttps://github.com/facelessuser/wcmatch/commit/83491aadde57780330f993620083e979f645c80c\nhttps://github.com/facelessuser/wcmatch/releases/tag/11.2\nhttps://github.com/facelessuser/wcmatch/security/advisories/GHSA-53pm-wgxf-c6qf\nhttps://github.com/facelessuser/wcmatch/security/advisories/GHSA-53pm-wgxf-c6qf","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-132276","published_at":"2026-11-20T17:18:12.723000Z","updated_at":"2026-11-20T20:17:34.707000Z","fetched_at":"2026-11-21T19:15:31.485418Z","severity":"medium","cvss_score":5.9,"epss":0.00881,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-132276","vuln_ids":["CVE-2026-132276","GHSA-53PM-WGXF-C6QF","GHSA-84V8-QMGQ-9G88"],"tags":["CWE-1333"],"cluster_id":1979,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/9919","html":"https://vulnwatch.ve1ve2.com/item/9919"}}]}