Skip to content

chore(deps-dev): override glob and minimatch to clear GHSA-g3hv-75wg-m249 - #84

Merged
chrischall merged 1 commit into
mainfrom
fix/minimatch-advisory
Nov 3, 2026
Merged

chrischall merged 1 commit into
mainfrom
fix/minimatch-advisory

Conversation

@chrischall

Copy link
Copy Markdown
Owner

Fixes Dependabot alert #8: minimatch < 11.0.1, pattern-amplification DoS (GHSA-g3hv-75wg-m249, medium).

Why an override, and why two packages

  • minimatch comes in only through @opencode/plugin's own dependencies (@opencode/util, @npmcli/arborist, @tufjs/models, rimraf→glob…). It's dev-only: we import @opencode/plugin for types and for the schema test, and none of this ships to users.
  • The advisory covers 10.2.6 too; there's no fix on the 9.x or 10.x lines. The only patched version is 11.0.1 and later, and every consumer asks for ^9 or ^10, so npm can't get there without overrides.
  • minimatch 11 is an API break. It removes makeRe(), Minimatch#regexp, matchOne() and AST, and set entries are no longer RegExps. A scan of the installed tree found glob 10 and 13 relying on exactly those (.makeRe, .matchOne, .regexp, instanceof RegExp), so overriding minimatch alone would leave glob broken.
  • glob 14.0.3 is the release built on minimatch 11 (it depends on ^11.0.2). Its glob()/globSync() API is unchanged, and every glob consumer here (@opencode/util, @npmcli/map-workspaces, @npmcli/package-json, cacache, rimraf) calls only those. The direct minimatch users call only minimatch(), minimatch.match() and new Minimatch(), which 11 keeps.

So: "overrides": { "glob": "^14.0.3", "minimatch": "^11.0.2" }. The tree now has one copy of each (glob 14.0.3, minimatch 11.0.4).

AGENTS.md records the override and when to drop it: once @opencode/plugin resolves minimatch ≥ 11.0.1 itself. The two entries have to go together.

Verification

  • npm audit: 0 vulnerabilities.
  • npm test (typecheck + vitest): 355/355. npm run build passes; plugin.d.mts is 0.12 kB.
  • Exercised the consumers against the overridden versions, since nothing in the suite runs them:
    • glob() and globSync({ ignore }) return the same file counts as ls;
    • opencode's own Glob.scan and Glob.match (@opencode/util) give correct results, including dot: true;
    • minimatch(), minimatch.match() and new Minimatch().match() behave correctly;
    • @npmcli/map-workspaces resolves.

chore(deps-dev): a dev-only change, so no release.

🤖 Generated with Claude Code

https://claude.ai/code/session_012aZHZ5fBse1HTCBF5yGdCw

…m249

minimatch < 11.0.1 has a pattern-amplification DoS, with no fix on the
9.x or 10.x lines. It reaches only the dev tree, through @opencode/plugin's
own dependencies. Override minimatch to ^11.0.2 together with glob ^14.0.3:
glob 13 and earlier use minimatch APIs that 11 removed, and glob 14 is the
release built on minimatch 11. Every other consumer uses only APIs 11 keeps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012aZHZ5fBse1HTCBF5yGdCw
@chrischall chrischall added dependencies Release notes: Dependencies (third-party bumps) security Release notes: Security labels Nov 3, 2026
@github-actions github-actions Bot added the auto-review Auto-review pipeline is handling this PR label Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

✅ Auto-review verdict: pass — Dev-only dependency override for glob and minimatch plus an AGENTS.md note; no runtime or source changes.

Reviewed commit e16599a.


No issues found. I read the diff and checked the lockfile.

  • package.json adds overrides for glob (^14.0.3) and minimatch (^11.0.2). package-lock.json resolves glob 14.0.3 and minimatch 11.0.4, so the lock agrees with the overrides.
  • The AGENTS.md note explains why the two packages move together and when to drop the overrides. This matches the repo's habit of documenting package.json decisions there.
  • No source, protocol, prompt, token-handling or test changes. The tool/API contract is unchanged.

Open questions (not run, so not counted toward the verdict):

  • Whether npm test passes under glob 14 and minimatch 11. I did not run a build or test.
  • pnpm-lock.yaml and yarn.lock are tracked, but the PR does not touch them. AGENTS.md says the repo is npm-only, so I did not treat this as a finding.

Verdict: pass

@chrischall chrischall added the ready-to-merge Arms auto-merge — added by the pipeline on a pass/warn verdict, never by hand label Nov 3, 2026
@chrischall
chrischall enabled auto-merge (squash) November 3, 2026 15:49
@chrischall
chrischall merged commit b737b21 into main Nov 3, 2026
29 checks passed
@chrischall
chrischall deleted the fix/minimatch-advisory branch November 3, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-review Auto-review pipeline is handling this PR dependencies Release notes: Dependencies (third-party bumps) ready-to-merge Arms auto-merge — added by the pipeline on a pass/warn verdict, never by hand security Release notes: Security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant