Skip to content

Update dependency wcmatch to v11.2 [SECURITY] - #284

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/pypi-wcmatch-vulnerability
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/pypi-wcmatch-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
wcmatch 11.0.1 → 11.2 age confidence

wcmatch: Polynomial-time ReDoS when matching untrusted names against multi-star patterns (default flags)

CVE-2026-132276 / GHSA-53pm-wgxf-c6qf

More information

Details

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):

*_*_*_*_*.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
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:

*_*_*_*.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   len=200  wcmatch=22.415s  stdlib=0.00007s
*_*_*_*_*.csv   len=255  wcmatch=72.732s  stdlib=0.00047s
globmatch 85.75s

glob.glob('*_*_*_*.csv', root_dir=d) on a real directory that contains one file named '_' * 255 takes 1.7 s.

Impact

Applications 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.

Fix

Emit 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:

^(?s:(?=.)(?![.])(?>.*?_)(?>.*?_)(?>.*?_)(?>.*?_).*?\.csv)$

This 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

  • CVSS Score: 5.9 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

facelessuser/wcmatch (wcmatch)

v11.2

Compare Source

11.2

  • NEW: Drop support for Python 3.10.
  • FIX: Require bracex 3.2 for various bug fixes.
  • FIX: Filter filename iterables without evaluating their "truthiness", allowing collections such as numpy
    arrays (@​Lushiyao5).
  • FIX: Improve performance when multiple * are used for file name matching. Performance is only improved in
    cases where variable length EXTGLOB patterns would not interfere with matching. Issue found by (@​gistrec).
  • FIX: Apply one pattern limit to includes and exclusions when scanning with glob and iglob, and preserve
    unlimited expansion across multiple patterns with negative limits.
  • FIX: Use the documented default limit of 1000 patterns in WcMatch instead of 32.
  • FIX: Preserve unlimited pattern expansion with exclusions in compiled matchers and translation, and enforce
    finite limits when exclusions consume the entire pattern budget.
  • FIX: Fix an invalid regular expression error when an EXTGLOB/EXTMATCH inverse group, !(...), is followed
    by an extended group that contains another extended group, e.g. !(a)@(b|*(c)).
  • FIX: Fix an EXTGLOB/EXTMATCH star group, *(...), being matched as literal text when it directly follows
    another *, e.g. a**(b).
  • FIX: Fix glob and iglob returning the same path twice when two patterns find it and case is ignored, e.g.
    ['A*', '*b'] with IGNORECASE and a file named Ab. Files that only differ by case are no longer treated as
    duplicates when the file system is case sensitive.
  • FIX: According to Bash, a file name that starts with an extended group should never match . or ...
  • FIX: Preserve leading-dot restrictions for wildcards after extended groups that can match an empty string,
    such as ?(a)*, and avoid returning . and .. from these directory scans.
  • FIX: Fix rglob treating a pattern that starts with ** or *** as if it started with *, e.g. **/a.txt
    with GLOBSTAR missed a.txt in the searched folder and returned a.txt from inside a symlinked folder.

v11.1

Compare Source

11.1

  • NEW: Add support for Python 3.15.
  • FIX: Fix WindowsPath subclass construction on Python 3.12+ (#​238).
  • FIX: Fix symlink prefixes for multiple GLOBSTAR captures (#​239).

Configuration

📅 Schedule: (in timezone UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot requested a review from mishushakov as a code owner November 21, 2026 02:00
@cla-bot cla-bot Bot added the cla-signed label Nov 21, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T02:02:44.036396Z 24b91c9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24b91c9190

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread template/uv.lock
[[package]]
name = "bracex"
version = "3.0.1"
version = "3.2.4"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep bracex behind the configured release-age gate

At this commit's timestamp (2026-11-21 02:00 UTC), bracex 3.2.4 had been uploaded only about 13 hours earlier, as the adjacent lockfile metadata confirms. This bypasses the three-day quarantine in renovate.json5:17-19, which explicitly exists to let compromised releases be withdrawn. Since wcmatch 11.2 permits any bracex>=3.2 and the eligible 3.2.3 release had existed since November 14, lock an older 3.2.x release or wait until 3.2.4 passes the configured age gate. (wcmatch 11.2 dependency declaration, bracex 3.2.3 release)

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants