Repository navigation
Guard: no caller runs minimatch's level-2 preprocessing - #79
Merged
Merged
Conversation
Owner's decision 2026-11-03 for Dependabot alert #100 (minimatch, GHSA-g3hv-75wg-m249, medium): dismiss as "vulnerable code not used" and keep a guard. The fix exists only in minimatch 11.0.1; eslint (^3) and @typescript-eslint/typescript-estree (^10.2.2) do not accept it. The test fails if a minimatch copy below 11.0.1 becomes a runtime dependency, or if a package that declares minimatch starts passing optimizationLevel (the vulnerable code runs only at level 2 or higher). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Owner's decision 2026-11-03 for Dependabot alert #100 (
minimatch, medium): dismiss as "vulnerable code not used" and keep a guard, the same way as #78sprintf-js. The alert is dismissed after this PR lands, with a link here. No dependency changes.Why the code is not used
optimizationLevel≥ 2, each**/..split infirstPhasePreProcess()doubles the pattern set, andsecondPhasePreProcess()then compares it pairwise, which costs CPU and memory. The range is< 11.0.1. The fix is only in 11.0.1, a major: no 10.x or 3.x backport.minimatch3.1.5, fromeslint,@eslint/config-array,@eslint/eslintrc(^3.1.5) and theeslint-config-nextplugins (^3.1.2). 3.x has no level-2 code at all. A correction of the advisory range ("introduced 7.0.0") is proposed in Fix affected range for GHSA-g3hv-75wg-m249 github/advisory-database#10807.minimatch10.2.5, from@typescript-eslint/typescript-estree8.58.1 (^10.2.2). The latest release 8.72.1 and the canary also use^10.2.2(Bug: typescript-estree's minimatch ^10 is flagged by CVE-2026-118764, fixed only in minimatch 11 typescript-eslint/typescript-eslint#13125). Its only call isminimatch(filePath, pattern, { dot: true })forallowDefaultProject, at the default level 1. We don't useprojectServiceat all.node_modulesother than minimatch itself passesoptimizationLevel. There is noglobin the tree, and our code doesn't import minimatch.Array(n).fill('**/../a/b').join('/'), level 2):makeRe(),Minimatch#regexpandAST, and it adds a new package (@isaacs/nonrecursive-glob-match). The 3.x copy can't move to 11 anyway, so the alert would stay open.The guard:
__tests__/minimatchLevelTwoUnused.spec.tsdevin the lock. This fails if one becomes a runtime dependency.optimizationLevel. The scan covers their own source files, without nested packages.typescript-estreeand sees itsrequire("minimatch").optimizationLevelin minimatch itself, so an empty result really means "not passed".cmp):devremoved fromnode_modules/minimatchin the lock →expected [ 'node_modules/minimatch@3.1.5' ] to deeply equal [].optimizationLevel: 2added to the typescript-estree call → fails with that file.require("minimatch")hidden in that file → the anchor fails.Checked locally
c00c53b: 366 files, 4348 tests, 0 failing.npm run lint✅,npx tsc --noEmit✅, prettier ✅.🤖 Generated with Claude Code