Fix brace-expansion DoS advisories (REV-72) - #46
Merged
Merged
Conversation
Clears two high-severity Dependabot advisories on brace-expansion: - GHSA-3jxr-9vmj-r5cp: DoS via exponential-time expansion of consecutive non-expanding {} groups (patched in 1.1.16 / 2.1.2). - GHSA-mh99-v99m-4gvg (CVE-2026-14257): DoS via unbounded expansion length causing an OOM crash; patched in 5.0.8 and backported to 1.1.17 / 2.1.3. Both installed copies were stale relative to their own semver ranges, so `npm update brace-expansion` was sufficient — lockfile-only, no override entry and no manifest change: - rimraf@2 -> glob@7 -> minimatch@3 (also eslint): 1.1.15 -> 1.1.17. Reachable from the production tree. - mocha@11 -> minimatch@9: 2.1.1 -> 2.1.3. Dev-only. Deliberately not overridden to 5.0.8: brace-expansion 5.x exports a named `expand` (exports.expand = expand) while minimatch does `const expand = require('brace-expansion')`, so forcing 5.x would break glob/rimraf/eslint/mocha at runtime. The maintenance backports are the fix. Verified against the installed copies: normal expansion unchanged (a{b,c}d{1..3} -> abd1,abd2,abd3,acd1,acd2,acd3 on both); 40 consecutive empty {} groups expand in 0ms; 6 chained 200KB groups now cap at 3.6M chars via the new EXPANSION_MAX_LENGTH=4000000 guard instead of growing unbounded. tsc --noEmit clean; eslint and mocha still resolve their globs. Note: npm audit and Dependabot will keep flagging GHSA-mh99-v99m-4gvg until GitHub amends it — the advisory declares one flat range `<= 5.0.7` with first_patched_version 5.0.8 and has not yet been updated for the 1.1.17 / 2.1.3 backports published 2026-07-28/29. The installed code is patched. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ashirman
approved these changes
Jul 29, 2026
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.
Clears Dependabot alerts #62 and #63.
{}groupsChange
Both installed copies were stale relative to their own semver ranges, so
npm update brace-expansionwas sufficient — lockfile-only, nooverridesentry and no manifest change:rimraf@2 → glob@7 → minimatch@3(also eslint)mocha@11 → minimatch@9Why not override to 5.0.8
brace-expansion 5.x exports a named
expand(exports.expand = expand), while minimatch doesconst expand = require('brace-expansion'). Forcing 5.x would break glob/rimraf/eslint/mocha at runtime. The maintenance backports are the correct fix.Verification
Run against the actually-installed copies:
a{b,c}d{1..3}→abd1,abd2,abd3,acd1,acd2,acd3on both.{}groups expand in 0 ms.EXPANSION_MAX_LENGTH = 4_000_000guard instead of growing unbounded.tsc --noEmitclean; eslint and mocha still resolve their globs.Known false positive after merge
npm auditand Dependabot will keep flagging GHSA-mh99-v99m-4gvg. That advisory currently declares one flat range<= 5.0.7withfirst_patched_version: 5.0.8and has not yet been amended for the 1.1.17 / 2.1.3 backports published 2026-07-28/29. The installed code is patched — confirmed by inspecting both tarballs and exercising the guard above.Linear: REV-72
🤖 Generated with Claude Code