Repository navigation
Renovate: dependency wcmatch to v11 [SECURITY] - #717
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #717 +/- ##
===========================================
+ Coverage 78.12% 89.27% +11.14%
===========================================
Files 71 81 +10
Lines 3612 4131 +519
===========================================
+ Hits 2822 3688 +866
+ Misses 790 443 -347 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
10.1→11.2wcmatch: 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 withfnmatch.fnmatch()and 86 s withglob.globmatch(). The standard library'sfnmatchhandles 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):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 ownfnmatch(bpo-40480) by making every star segment except the last one atomic.PoC
wcmatch 11.1, CPython 3.13, macOS:
glob.glob('*_*_*_*.csv', root_dir=d)on a real directory that contains one file named'_' * 255takes 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/WcMatchscans 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 fromfnmatch._join_translated_parts. For example: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:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
facelessuser/wcmatch (wcmatch)
v11.2Compare Source
11.2
bracex3.2 for various bug fixes.numpyarrays (@Lushiyao5).
*are used for file name matching. Performance is only improved incases where variable length
EXTGLOBpatterns would not interfere with matching. Issue found by (@gistrec).globandiglob, and preserveunlimited expansion across multiple patterns with negative limits.
WcMatchinstead of 32.finite limits when exclusions consume the entire pattern budget.
EXTGLOB/EXTMATCHinverse group,!(...), is followedby an extended group that contains another extended group, e.g.
!(a)@(b|*(c)).EXTGLOB/EXTMATCHstar group,*(...), being matched as literal text when it directly followsanother
*, e.g.a**(b).globandiglobreturning the same path twice when two patterns find it and case is ignored, e.g.['A*', '*b']withIGNORECASEand a file namedAb. Files that only differ by case are no longer treated asduplicates when the file system is case sensitive.
.or...such as
?(a)*, and avoid returning.and..from these directory scans.rglobtreating a pattern that starts with**or***as if it started with*, e.g.**/a.txtwith
GLOBSTARmisseda.txtin the searched folder and returneda.txtfrom inside a symlinked folder.v11.1Compare Source
11.1
WindowsPathsubclass construction on Python 3.12+ (#238).GLOBSTARcaptures (#239).v11.0.1Compare Source
11.0.1
expected from Wildcard Match in regards to security, and provide general information to allow users to make good
decisions.
EXTGLOB/EXTMATCHwas enabled.v11.0Compare Source
11.0
EXTGLOB/EXTMATCHregular expression patterns when possible to reduce deeplynested patterns.
<0-9>) via newNUMRANGEflag.EXTGLOB/EXTMATCHwas enabled. Due to the new feature added that reduces extended glob group nesting, groups nolonger appear exactly as specified. Moving forward, capturing groups are not included by default. If you need the
old behavior, it can be enabled in a
translate()call via theCAPTUREflag. This flag will cause extended globreduction to be turned off and for capturing groups to be enabled.
EXTGLOB/EXTMATCHparsing once an unclosed extended glob pattern is encountered.SPLITnot accounting for POSIX character class.v10.2.1Compare Source
10.2.1
bracex3.0.v10.2Compare Source
10.2
bracex3.0 for bug fixes.Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.