[security] Resolve brace-expansion Vulnerability via pnpm Override - #406
Merged
hayat01sh1da merged 1 commit intoJul 27, 2026
Merged
Conversation
hayat01sh1da
deleted the
hayat01sh1da/security/resolve-brace-expansion-vulnerability
branch
July 27, 2026 18:14
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.
1. Overview
Dependabot alerts #688 (
javascript/pnpm-lock.yaml) and #690 (typescript/pnpm-lock.yaml) both report GHSA-mh99-v99m-4gvg / CVE-2026-14257 (High, CVSS 7.5) against the transitive dependencybrace-expansion.expand()caps the number of results it produces but not their length, so chained brace groups such as'{a,b}'.repeat(1500)exhaust memory and kill the Node process with an uncatchable out-of-memory error.The advisory marks every published version up to
5.0.7as vulnerable and ships the fix only in5.0.8— there is no backport on the1.xor2.xmaintenance lines, so the two versions in both trees (1.1.16and2.1.2) cannot simply be patch-bumped.Because
brace-expansion@5exposes a namedexpandexport instead of a callablemodule.exports, the consumers that still expect the old shape (minimatch@3.1.5viarequire(),minimatch@9.0.9via a default import) had to move forward as well.This Pull Request therefore resolves the whole chain through
pnpmoverrides injavascript/pnpm-workspace.yamlandtypescript/pnpm-workspace.yaml, matching the existingjs-yamloverride convention.2. Key Changes & Differences
brace-expansion1.1.16,2.1.25.0.8EXPANSION_MAX_LENGTH(4,000,000) now bounds total output length in addition toEXPANSION_MAX.minimatch3.1.5,9.0.910.2.53.1.5callsrequire('brace-expansion')(pattern)and9.0.9calls its default export — both break againstbrace-expansion@5, whose CJS build exports only{ expand, EXPANSION_MAX, EXPANSION_MAX_LENGTH }.10.2.5uses the namedexpandimport and passesbraceExpandMax.babel-plugin-istanbul7.0.18.0.27.0.1pinstest-exclude@^6.0.0, which drags inglob@7→minimatch@3→brace-expansion@1.8.0.2pinstest-exclude@^7.0.1, removing that leg of the tree.test-exclude(transitive)6.0.07.0.2babel-plugin-istanbulbump; depends onglob@^10.4.1andminimatch@^10.2.2instead ofglob@^7.1.4andminimatch@^3.0.4.glob(transitive)7.2.3,10.5.010.5.0(javascript) /7.2.3,10.5.0(typescript)javascriptglob@7.2.3existed only to servetest-exclude@6.0.0and disappears with it. Intypescriptit is also required byglob-stream@6.1.0(gulp) and therefore stays, but now resolvesminimatch@10.2.5; aglob@7brace-pattern smoke test against that combination was run and returns the expected matches.javascript/pnpm-workspace.yaml,typescript/pnpm-workspace.yamljs-yaml)'brace-expansion@<=5.0.7': '^5.0.8','minimatch@<10.2.2': '^10.2.5'and'babel-plugin-istanbul@<8.0.2': '^8.0.2'next to the existingjs-yamlentry in both workspaces.3. Summary
brace-expansion1.1.16/2.1.2→5.0.8, leaving a single copy of the package in each tree.pnpmoverrides added per workspace;babel-plugin-istanbulandminimatchare bumped only becausebrace-expansion@5changed its export shape, not as an independent upgrade.pnpm exec jest(the commandJavaScript - CIandTypeScript - CIrun) passes in both workspaces: 19 suites / 153 tests injavascript, 5 suites / 5 tests intypescript.pnpm exec jest --coveragealso passes in both, which exercises thebabel-plugin-istanbul→test-exclude→globpath that this change rewires.reactjs/pnpm-lock.yamlandruby-on-rails/perfect-ruby-on-rails/pnpm-lock.yamlalso containbrace-expansion@1.1.16but have no Dependabot alert raised against them, so they are deliberately left out of this Pull Request.4. References