Skip to content

fix: force patched minimatch (GHSA-g3hv-75wg-m249) - #13

Merged
HandyS11 merged 1 commit into
mainfrom
fix/minimatch-override
Nov 7, 2026
Merged

HandyS11 merged 1 commit into
mainfrom
fix/minimatch-override

Conversation

@HandyS11

@HandyS11 HandyS11 commented Nov 7, 2026

Copy link
Copy Markdown
Owner

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.6 is a dev-only transitive dependency of:

Consumer Declared range
eslint@10.14.0 ^10.2.6
@eslint/config-array@0.23.5 ^10.2.4
eslint-plugin-sonarjs@4.2.2 ^10.2.6
@typescript-eslint/typescript-estree@8.72.1 ^10.2.2

These 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 overrides entry that pins minimatch to ^11.0.1. The lockfile resolves to 11.0.5, which adds @isaacs/nonrecursive-glob-match as a new dependency.

Why the major bump is safe here

The 11.0.0 breaking changes only remove the debug option and the matchOne(), slashSplit() and levelTwoFileOptimize() methods. I checked every call site in the four consumers: they only use new Minimatch(pattern, opts), .match(path[, partial]), .pattern and minimatch(), with the options dot, nocase, matchBase and nonegate. 11.x still ships both CommonJS and ESM builds, which matters because eslint loads it with require(). The new engines range (20 || >=22) covers the CI matrix (22, 24).

Once the upstream packages accept minimatch 11, the override can be removed.

Test plan

  • npm ci from the new lockfile; npm audit reports 0 vulnerabilities
  • npm ls minimatch --all: every consumer resolves 11.0.5, none flagged invalid
  • npm run lint is clean; the JSON formatter confirms all 15 src/**/*.ts files are linted (the config's files glob still matches)
  • A file with a planted error still gets sonarjs/no-invariant-returns and sonarjs/no-all-duplicated-branches reported
  • npm test: 53/53 pass

🤖 Generated with Claude Code

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>
Copilot AI balanced review requested due to automatic review settings November 7, 2026 15:30
@HandyS11
HandyS11 merged commit e831537 into main Nov 7, 2026
6 checks passed
@HandyS11
HandyS11 deleted the fix/minimatch-override branch November 7, 2026 15:32

Copilot AI 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.

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 overrides rule to pin minimatch to ^11.0.1 (lockfile resolves 11.0.5).
  • Update package-lock.json to 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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants