Skip to content

fix(deps): override vulnerable minimatch in the packaging toolchain - #86

Merged
SPhillips1337 merged 1 commit into
mainfrom
ag/minimatch-override
Nov 9, 2026
Merged

SPhillips1337 merged 1 commit into
mainfrom
ag/minimatch-override

Conversation

@SPhillips1337

Copy link
Copy Markdown
Contributor

Summary

Clears the last audit finding, GHSA-g3hv-75wg-m249 in minimatch, so the release workflow's npm audit --audit-level=moderate passes. Until now it blocked releases.

  • Where it comes from: electron-builder's app-builder-lib and @electron/universal depend on minimatch ^10.2.5 and ^9.0.3. The fix only exists in 11.0.1+, the latest electron-builder still pins ^10, and npm audit fix --force would downgrade electron-builder to 25.1.0.
  • The change: one overrides entry, "minimatch@>=7.0.0 <11.0.1": "^11.0.5", keyed on the vulnerable range only. The 3.x and 5.x copies used by glob@7, dir-compare and filelist are left alone. A parent-scoped override was tried first; it also forced 11.x onto glob@7, which expects the old API, so it was dropped.

Testing

  • npm audit reports 0 vulnerabilities, including at moderate level.
  • npm run typecheck is clean, and npm test passes (1203 passed, 3 skipped).
  • minimatch 11 exports the same Minimatch class and minimatch function the packaging tools use, with the dot and matchBase options. It gives the same results as 9.x on sample patterns.
  • electron-builder --win dir --x64 -c.npmRebuild=false packaged successfully. Its app.asar contains exactly the build.files set (dist/main, dist/renderer, package.json) plus runtime dependencies, with no sources, tests or dev tools, and node-pty unpacked as before.

Not tested locally: a full npm run package:win (NSIS installer and portable exe). The rebuild of node-pty's native module fails on the build machine for reasons unrelated to this change: its Visual Studio Build Tools lack the Spectre-mitigated libraries. That step runs before any file matching, and main fails there in the same way. The release workflow's runners will be the first full installer build.

🤖 Generated with Claude Code

Clears the last moderate audit finding (GHSA-g3hv-75wg-m249), which blocked
the release workflow's `npm audit --audit-level=moderate`. electron-builder's
app-builder-lib and @electron/universal pin minimatch ^10 / ^9, which the fix
never reached; even the latest electron-builder still does.

The override is keyed on the vulnerable range only
(`minimatch@>=7.0.0 <11.0.1`), so the 3.x and 5.x copies other packages use
keep their own API. A parent-scoped override was tried first and forced 11.x
onto glob@7 as well.

Checked with minimatch 11 in place: `npm audit` reports 0 vulnerabilities;
typecheck and tests pass; electron-builder packages the Windows app, and its
asar holds exactly the `build.files` set (dist/main, dist/renderer,
package.json, runtime deps) with no sources, tests or dev tools.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

@amazon-q-developer amazon-q-developer Bot 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.

Review Summary

This PR adds a targeted npm overrides entry to eliminate the last remaining audit finding (GHSA-g3hv-75wg-m249) in minimatch without downgrading electron-builder.

Assessment: The change is correct and safe to merge.

The override key "minimatch@>=7.0.0 <11.0.1": "^11.0.5" is precisely scoped:

  • It correctly targets the vulnerable range (≥7.0.0 and <11.0.1) used by app-builder-lib (^10.2.5) and @electron/universal (^9.0.3).
  • The lock file correctly retains separate scoped copies of minimatch 3.x and 5.x for @electron/asar, dir-compare, glob@7, and filelist — all of which were outside the override range and rely on the old API. This confirms the previously-attempted parent-scoped override issue (which would have forced 11.x onto glob@7) was properly avoided.
  • The removal of the @electron/universal/node_modules/minimatch (9.0.9) hoisted entry and its helpers is the expected lock file consequence of the override redirecting that resolution to the top-level 11.0.5.
  • The addition of @isaacs/nonrecursive-glob-match is a legitimate new transitive dependency introduced by minimatch 11.

No blocking issues found. The PR description, implementation, and lock file changes are all consistent with each other.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@SPhillips1337
SPhillips1337 merged commit 5f69efa into main Nov 9, 2026
3 checks passed
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.

1 participant