Skip to content

chore(deps): update dependency brace-expansion@<1.1.16 to v5 [security] - autoclosed - #9294

Closed
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/npm-brace-expansion-1.1.16-vulnerability
Closed

chore(deps): update dependency brace-expansion@<1.1.16 to v5 [security] - autoclosed#9294
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/npm-brace-expansion-1.1.16-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
brace-expansion@<1.1.16 ^1.1.16^5.0.8 age confidence

brace-expansion: DoS via unbounded expansion length causing an out-of-memory process crash

CVE-2026-14257 / GHSA-mh99-v99m-4gvg

More information

Details

Summary

expand() bounds the number of results it produces (the max option,
100_000 by default) but not their length. By chaining many brace groups,
an attacker keeps the result count under max while making every result grow
with the number of groups. Building max long results — plus the intermediate
arrays combined at each brace group — exhausts memory and crashes the Node
process with an uncatchable out-of-memory error. try/catch around
expand() does not help: the fatal error terminates the process.

A ~7.5 KB input ('{a,b}'.repeat(1500)) is enough to crash a default Node
process.

Details

For N chained brace groups such as '{a,b}'.repeat(N):

  • the result count is 2^N, immediately capped at max (100_000), so the
    max protection appears to hold, but
  • each result is N characters long, so the total output size is
    max × N characters, which grows without bound in N.

expand_ combines each brace set with the fully-expanded tail:

const post = m.post.length ? expand_(m.post, max, false) : ['']
...
for (let j = 0; j < N.length; j++) {
  for (let k = 0; k < post.length && expansions.length < max; k++) {
    const expansion = pre + N[j] + post[k]   // grows one group longer per level
    ...
    expansions.push(expansion)
  }
}

The loop guard expansions.length < max limits how many strings are built, but
nothing limits how long they get. Each recursion level materializes another
array of up to max strings, one character longer than the level below, and —
because V8 represents pre + N[j] + post[k] as a cons-string (rope) that
references post[k] — those intermediate strings stay reachable through the
whole chain. Memory therefore scales with max × N.

Measured on 5.0.7 ('{a,b}'.repeat(N), default max):

groups (N) input bytes result count peak RSS
20 100 100,000 ~80 MB
50 250 100,000 ~214 MB
100 500 100,000 ~409 MB
300 1,500 100,000 ~1,148 MB
1500 7,500 OOM crash
Proof of concept
const { expand } = require('brace-expansion')

// ~7.5 KB input — crashes the process with a fatal, uncatchable OOM:
//   FATAL ERROR: ... JavaScript heap out of memory
try {
  expand('{a,b}'.repeat(1500))
} catch (e) {
  // never reached — the process is already dead
}
Impact

Any application that passes attacker-influenced strings to
brace-expansion.expand() — directly, or transitively via minimatch / glob
brace patterns — can be crashed by a small request. Because the failure is a
fatal V8 out-of-memory error rather than a thrown exception, it cannot be caught
and it takes down the whole worker/process, denying service.

Remediation

Upgrade to a patched release. The fix bounds the total number of characters a
single expand() call may accumulate (EXPANSION_MAX_LENGTH, default
4_000_000, configurable via a new maxLength option), applied inside the
output-building loops so intermediate arrays are bounded too. Once the limit is
reached, output is truncated — consistent with how max already truncates —
instead of growing without bound. The limit sits well above any realistic
expansion (100,000 results hitting max measure ~1M characters), so legitimate
input is unaffected.

After the fix, '{a,b}'.repeat(1500) returns a bounded, truncated result in
~0.7 s using ~340 MB and never crashes, including under a constrained 512 MB
heap.

The fix bounds memory but the algorithm still rebuilds intermediate arrays at
each level (roughly O(N × maxLength) work on this input class). A streaming
rewrite that produces output in O(total output size) can be a non-urgent
follow-up.

If immediate upgrade isn't possible, avoid passing untrusted input to
expand() / glob brace patterns, or pass a small explicit max and
maxLength.

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

juliangruber/brace-expansion (brace-expansion@<1.1.16)

v5.0.8

Compare Source

v5.0.7

Compare Source

v5.0.6

Compare Source

v5.0.5

Compare Source

v5.0.4

Compare Source

v5.0.3

Compare Source

v5.0.2

Compare Source

v4.0.1

Compare Source


v4.0.0

Compare Source

As a precaution to not risk breaking anything with 278132b, this is a new semver major release

v3.0.6

Compare Source

v3.0.5

Compare Source

v3.0.4

Compare Source

v3.0.3

Compare Source

v3.0.2

Compare Source

v3.0.1

Compare Source


v3.0.0

Compare Source

v2.1.4

Compare Source

v2.1.3

Compare Source

v2.1.2

Compare Source

v2.1.1

Compare Source


v2.1.0

Compare Source

v2.0.3

Compare Source

v2.0.2

Compare Source


v2.0.1

Compare Source

v2.0.0

v1.1.17

Compare Source


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Copilot AI review requested due to automatic review settings July 28, 2026 05:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.

Updates the dependency override for brace-expansion in package.json, likely to address a security/advisory constraint on older brace-expansion versions.

Changes:

  • Changed the override for brace-expansion@<1.1.16 from ^1.1.16 to ^5.0.0.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown

COMPARE TO master

Total Size Diff 📉 -919 Bytes

Diff by File
Name Diff
package.json 📉 -1 Bytes
pnpm-lock.yaml 📉 -918 Bytes

@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-1.1.16-vulnerability branch from 2c9869e to 6aaaaaa Compare July 28, 2026 06:30
Copilot AI review requested due to automatic review settings July 28, 2026 06:30
@github-actions github-actions Bot added size/xs and removed size/xs labels Jul 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread package.json
"axios@<1.18.0": "^1.18.0",
"basic-ftp@<=5.2.2": "^5.3.0",
"brace-expansion@<1.1.16": "^1.1.16",
"brace-expansion@<1.1.16": "^5.0.8",
Copilot AI review requested due to automatic review settings July 28, 2026 06:37
@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-1.1.16-vulnerability branch from 6aaaaaa to 375f435 Compare July 28, 2026 06:37
@github-actions github-actions Bot added size/xs and removed size/xs labels Jul 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread package.json Outdated
"axios@<1.18.0": "^1.18.0",
"basic-ftp@<=5.2.2": "^5.3.0",
"brace-expansion@<1.1.16": "^1.1.16",
"brace-expansion@<1.1.16": "^5.0.0",
Copilot AI review requested due to automatic review settings July 28, 2026 06:45
@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-1.1.16-vulnerability branch from 375f435 to d05f0ec Compare July 28, 2026 06:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread package.json
"axios@<1.18.0": "^1.18.0",
"basic-ftp@<=5.2.2": "^5.3.0",
"brace-expansion@<1.1.16": "^1.1.16",
"brace-expansion@<1.1.16": "^5.0.8",
@github-actions github-actions Bot added size/xs and removed size/xs labels Jul 28, 2026
Copilot AI review requested due to automatic review settings July 29, 2026 03:19
@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-1.1.16-vulnerability branch from d05f0ec to 09ac91d Compare July 29, 2026 03:19
@github-actions github-actions Bot added size/xs and removed size/xs labels Jul 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file
Comments suppressed due to low confidence (1)

package.json:56

  • Overriding requests for brace-expansion@<1.1.16 to ^5.0.0 is a major-version jump and can break transitive consumers that expect the v1 API/behavior (especially older packages constraining to <1.1.16). If the intent is a security patch, consider keeping the override within the v1 line (e.g., pin to 1.1.16) or, if a major bump is required, document why this is safe and prefer aligning with the existing v5 override you already have (e.g., ^5.0.8) to minimize version skew.
      "brace-expansion@<1.1.16": "^5.0.0",

@github-actions github-actions Bot added size/xs and removed size/xs labels Jul 29, 2026
Copilot AI review requested due to automatic review settings July 29, 2026 03:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread package.json Outdated
"axios@<1.18.0": "^1.18.0",
"basic-ftp@<=5.2.2": "^5.3.0",
"brace-expansion@<1.1.16": "^1.1.16",
"brace-expansion@<1.1.16": "^5.0.0",
Copilot AI review requested due to automatic review settings July 30, 2026 03:35
@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-1.1.16-vulnerability branch from e018e5c to 24689fb Compare July 30, 2026 03:35
@github-actions github-actions Bot added size/xs and removed size/xs labels Jul 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread package.json
"axios@<1.18.0": "^1.18.0",
"basic-ftp@<=5.2.2": "^5.3.0",
"brace-expansion@<1.1.16": "^1.1.16",
"brace-expansion@<1.1.16": "^5.0.8",
Copilot AI review requested due to automatic review settings July 30, 2026 04:02
@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-1.1.16-vulnerability branch from 24689fb to f5b3051 Compare July 30, 2026 04:02
@github-actions github-actions Bot added size/xs and removed size/xs labels Jul 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Copilot AI review requested due to automatic review settings July 30, 2026 04:46
@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-1.1.16-vulnerability branch from f5b3051 to ea2d2f5 Compare July 30, 2026 04:46
@github-actions github-actions Bot added size/xs and removed size/xs labels Jul 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread package.json Outdated
Comment on lines 56 to 58
"brace-expansion@<1.1.16": "^5.0.0",
"brace-expansion@>=2.0.0 <2.1.2": "^2.1.2",
"brace-expansion@>=4.0.0 <5.0.8": "^5.0.8",
Copilot AI review requested due to automatic review settings July 30, 2026 04:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread package.json
"axios@<1.18.0": "^1.18.0",
"basic-ftp@<=5.2.2": "^5.3.0",
"brace-expansion@<1.1.16": "^1.1.16",
"brace-expansion@<1.1.16": "^5.0.8",

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file
Comments suppressed due to low confidence (1)

package.json:56

  • This override targets dependents that request brace-expansion versions <1.1.16 (v1.x range) but forces them to resolve to ^5.0.0 (a major-version jump). That can break transitive dependencies that relied on v1.x behavior/exports. If the goal is to remediate a v1.x vulnerability, consider pinning to 1.1.16 (within v1) instead, or adjust the selector to target ranges that are known-compatible with v5 (and document/validate compatibility).
      "brace-expansion@<1.1.16": "^5.0.0",

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread package.json
"axios@<1.18.0": "^1.18.0",
"basic-ftp@<=5.2.2": "^5.3.0",
"brace-expansion@<1.1.16": "^1.1.16",
"brace-expansion@<1.1.16": "^5.0.8",

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread package.json Outdated
"axios@<1.18.0": "^1.18.0",
"basic-ftp@<=5.2.2": "^5.3.0",
"brace-expansion@<1.1.16": "^1.1.16",
"brace-expansion@<1.1.16": "^5.0.0",

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread package.json
"axios@<1.18.0": "^1.18.0",
"basic-ftp@<=5.2.2": "^5.3.0",
"brace-expansion@<1.1.16": "^1.1.16",
"brace-expansion@<1.1.16": "^5.0.8",

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread package.json Outdated
"axios@<1.18.0": "^1.18.0",
"basic-ftp@<=5.2.2": "^5.3.0",
"brace-expansion@<1.1.16": "^1.1.16",
"brace-expansion@<1.1.16": "^5.0.0",

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread package.json
"axios@<1.18.0": "^1.18.0",
"basic-ftp@<=5.2.2": "^5.3.0",
"brace-expansion@<1.1.16": "^1.1.16",
"brace-expansion@<1.1.16": "^5.0.8",

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread package.json Outdated
"axios@<1.18.0": "^1.18.0",
"basic-ftp@<=5.2.2": "^5.3.0",
"brace-expansion@<1.1.16": "^1.1.16",
"brace-expansion@<1.1.16": "^5.0.0",

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file
Suppressed comments (1)

package.json:58

  • Overriding a <1.1.16 (v1) constraint to ^5.0.0 forces a major-version jump that may break transitive dependents expecting the v1 API/behavior. If the intent is to patch the vulnerable v1 range, prefer overriding to a patched v1 release (e.g., 1.1.16 or ^1.1.16) to stay within the same major. If you’ve validated that v5 is compatible for those consumers, consider aligning to a single v5 target (e.g., ^5.0.8) for consistency with the other override.
      "brace-expansion@<1.1.16": "^5.0.0",
      "brace-expansion@>=2.0.0 <2.1.2": "^2.1.2",
      "brace-expansion@>=4.0.0 <5.0.8": "^5.0.8",

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread package.json
Comment on lines 53 to 58
"ajv@>=7.0.0-alpha.0 <8.18.0": "^8.18.0",
"axios@<1.18.0": "^1.18.0",
"basic-ftp@<=5.2.2": "^5.3.0",
"brace-expansion@<1.1.16": "^1.1.16",
"brace-expansion@<1.1.16": "^5.0.8",
"brace-expansion@>=2.0.0 <2.1.2": "^2.1.2",
"brace-expansion@>=4.0.0 <5.0.8": "^5.0.8",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant