fix(deps): collapse minimatch onto 10 to clear brace-expansion advisory - #220
Merged
Conversation
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.
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.
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) andreaddir-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 onbrace-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 constructnew Minimatch(...)instead. Verified rather than assumed:exceljswrites 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@7returns identical results under both versions across literal,*,**, brace, character-class, extglob and dotfile patterns, andMinimatchnegation, partial matching,filterandhasMagicbehave the same. The only difference is the internal_srcregex string, which glob does not read.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
minimumReleaseAgepolicy 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.