Repository navigation
fix: force patched minimatch (GHSA-g3hv-75wg-m249) - #13
Merged
Merged
Conversation
minimatch < 11.0.1 can be made to burn CPU and memory by a crafted glob pattern (**/../ amplification). It reaches us only through dev tooling: eslint, @eslint/config-array, eslint-plugin-sonarjs and @typescript-eslint/typescript-estree, which all still declare ^10.2.x, so no upstream bump picks up the fix yet. An npm override pins minimatch to ^11.0.1 (resolves 11.0.5). The 11.0 breaking changes only remove the debug option and the matchOne, slashSplit and levelTwoFileOptimize methods; none of the four consumers uses them (they call new Minimatch(), .match(), .pattern and minimatch()). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🟢 Approval recommended
The change cleanly mitigates the reported minimatch vulnerability by enforcing a patched 11.x override and updating the lockfile accordingly, with only an optional note to clarify Node engine compatibility.
No open issues 🎉
What changed in this PR
This pull request addresses Dependabot alert GHSA-g3hv-75wg-m249 / CVE-2026-118764 by forcing a patched minimatch release via npm overrides, ensuring the vulnerable <11.0.1 line is not installed even though upstream dev-tool dependencies still request 10.x.
Changes:
- Add an npm
overridesrule to pinminimatchto^11.0.1(lockfile resolves11.0.5). - Update
package-lock.jsonto reflect the new resolved dependency tree (including@isaacs/nonrecursive-glob-match).
| File | Summary |
|---|---|
package.json |
Adds an npm override forcing minimatch to the patched 11.x line. Review note: since minimatch@11 enforces Node engines `20 |
package-lock.json |
Updates the lockfile to resolve minimatch@11.0.5 and record newly introduced transitive dependencies. |
Review effort: Balanced
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.
Summary
Closes Dependabot alert #1: GHSA-g3hv-75wg-m249 / CVE-2026-118764, a medium-severity denial of service in
minimatch(>= 7.0.0, < 11.0.1). A crafted glob pattern containing**/../makes the preprocessing step produce more and more pattern variants and then compare them pairwise (quadratic), which uses up CPU and memory.minimatch@10.2.6is a dev-only transitive dependency of:eslint@10.14.0^10.2.6@eslint/config-array@0.23.5^10.2.4eslint-plugin-sonarjs@4.2.2^10.2.6@typescript-eslint/typescript-estree@8.72.1^10.2.2These are the latest published versions, and all of them still require minimatch 10, so no upstream bump is available. The patched release is only on the 11.x line.
Change
Add an npm
overridesentry that pinsminimatchto^11.0.1. The lockfile resolves to11.0.5, which adds@isaacs/nonrecursive-glob-matchas a new dependency.Why the major bump is safe here
The 11.0.0 breaking changes only remove the
debugoption and thematchOne(),slashSplit()andlevelTwoFileOptimize()methods. I checked every call site in the four consumers: they only usenew Minimatch(pattern, opts),.match(path[, partial]),.patternandminimatch(), with the optionsdot,nocase,matchBaseandnonegate. 11.x still ships both CommonJS and ESM builds, which matters becauseeslintloads it withrequire(). The newenginesrange (20 || >=22) covers the CI matrix (22, 24).Once the upstream packages accept minimatch 11, the override can be removed.
Test plan
npm cifrom the new lockfile;npm auditreports 0 vulnerabilitiesnpm ls minimatch --all: every consumer resolves11.0.5, none flagged invalidnpm run lintis clean; the JSON formatter confirms all 15src/**/*.tsfiles are linted (the config'sfilesglob still matches)sonarjs/no-invariant-returnsandsonarjs/no-all-duplicated-branchesreportednpm test: 53/53 pass🤖 Generated with Claude Code