Vulnerabilities in pkg:pypi/wcmatch
PACKAGECVE-2026-132276 is a MODERATE (CVSS 5.9) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting wcmatch libraries in the PyPI ecosystem. The issue involves polynomial-time redos when matching untrusted names against multi-star patterns (default flags). Remediation is available by upgrading affected packages to version 11.2.
pkg:pypi/wcmatch
Vulnerability advisories affecting package pkg:pypi/wcmatch. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-53pm-wgxf-c6qf | CVE-2026-132276 | MODERATE | wcmatch: Polynomial-time ReDoS when matching untrusted names against multi-star patterns (default flags) |
CVE-2026-132276 at a Glance
Security Impact
CVSS: 5.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2026-132276
To remediate this vulnerability, upgrade all affected wcmatch dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install wcmatch>=11.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show wcmatch
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-132276, inspect your installed packages using pip:
pip show wcmatch
Analyze the terminal output to locate any version of wcmatch in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 11.2), your application is affected.
Note: The pip show wcmatch command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In wcmatch, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-132276 Affected wcmatch Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
wcmatch
|
PyPI |
< 11.2
|
11.2
|
References
Frequently Asked Questions
What is CVE-2026-132276?
Which wcmatch versions are affected?
What version fixes CVE-2026-132276?
Is wcmatch affected?
What is the CVSS score of CVE-2026-132276?
What CWE is associated with CVE-2026-132276?
How can I check PyPI dependencies for CVE-2026-132276?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-53pm-wgxf-c6qf",
"modified" : "2026-11-20T23:49:18Z",
"published" : "2026-11-20T23:49:18Z",
"aliases" : [ "CVE-2026-132276" ],
"summary" : "wcmatch: Polynomial-time ReDoS when matching untrusted names against multi-star patterns (default flags)",
"details" : "# 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 to `_PATH_STAR`.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "wcmatch"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "11.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 11.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/facelessuser/wcmatch/security/advisories/GHSA-53pm-wgxf-c6qf"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-132276"
}, {
"type" : "WEB",
"url" : "https://github.com/facelessuser/wcmatch/commit/83491aadde57780330f993620083e979f645c80c"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/facelessuser/wcmatch"
}, {
"type" : "WEB",
"url" : "https://github.com/facelessuser/wcmatch/releases/tag/11.2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-11-20T23:49:18Z",
"nvd_published_at" : "2026-11-20T17:18:12Z"
}
}