Skip to content

fix(deps): collapse minimatch onto 10 to clear brace-expansion advisory - #220

Merged
Musiker15 merged 1 commit into
mainfrom
fix/minimatch-brace-expansion-tail
Jul 25, 2026
Merged

fix(deps): collapse minimatch onto 10 to clear brace-expansion advisory#220
Musiker15 merged 1 commit into
mainfrom
fix/minimatch-brace-expansion-tail

Conversation

@Musiker15

Copy link
Copy Markdown
Member

Follow-up to #219, which patched brace-expansion within each major line. That cleared GHSA-3jxr-9vmj-r5cp but not GHSA-mh99-v99m-4gvg: the second advisory is only fixed in 5.0.8 and flags the entire range at or below 5.0.7, which in semver terms includes the freshly patched 1.1.16 and 2.1.2.

The 1.x and 2.x copies only existed because glob@7 (via archiver-utils and rimraf@2) and readdir-glob@1 (via archiver, which comes from exceljs) depend on minimatch 3.x/5.x. Lifting minimatch itself to 10 removes both: minimatch 10 depends on brace-expansion@^5, so 5.0.8 ends up as the single copy in the tree and the 1.x/2.x overrides become unnecessary.

Why this is safe here. The incompatibility in minimatch 10 is that its CommonJS export is an object rather than a callable, so consumers doing require("minimatch")(...) break. Both of our consumers construct new Minimatch(...) instead. Verified rather than assumed:

  • exceljs writes a byte-identical workbook (6625 bytes, same roundtrip values including non-ASCII and brace literals) under minimatch 3.1.5 and 10.2.5.
  • glob@7 returns identical results under both versions across literal, *, **, brace, character-class, extglob and dotfile patterns, and Minimatch negation, partial matching, filter and hasMagic behave the same. The only difference is the internal _src regex string, which glob does not read.
  • No first-party code imports glob, minimatch or archiver.
  • minimatch 10 requires node 20 || >=22; the repo requires >=22.

The lockfile only loses entries (minimatch 3.1.5/5.1.9, brace-expansion 1.1.16/2.1.2, concat-map) and gains none, so the minimumReleaseAge policy is not in play.

Residual risk worth naming: the checks above cover the write path exceljs actually uses. Archiver's glob-driven directory() API is not exercised by exceljs and therefore not covered.

GHSA-mh99-v99m-4gvg is only fixed in brace-expansion 5.0.8 and flags the whole
range at or below 5.0.7, so the 1.x and 2.x copies stayed flagged even after
being patched to 1.1.16 and 2.1.2. Those copies only existed because glob@7
(archiver-utils, rimraf@2) and readdir-glob@1 (archiver, via exceljs) depend on
minimatch 3.x/5.x.

Lifting minimatch itself to 10 removes them: minimatch 10 depends on
brace-expansion ^5, so 5.0.8 becomes the single copy in the tree and the 1.x/2.x
overrides are no longer needed.

Both consumers use `new Minimatch(...)` rather than calling the module export as
a function, which is the incompatibility in minimatch 10 (its CommonJS export is
an object). Verified against the real consumer path: exceljs writes a
byte-identical workbook under minimatch 3.1.5 and 10.2.5, and glob@7 results,
negation, partial matching and filter are identical between both versions.
@Musiker15
Musiker15 merged commit 50f5ef0 into main Jul 25, 2026
5 checks passed
@Musiker15
Musiker15 deleted the fix/minimatch-brace-expansion-tail branch July 25, 2026 13:53
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