Skip to content

chore(deps): update dependency brace-expansion@<2 to v2 [security] - #752

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-brace-expansion-2-vulnerability
Open

chore(deps): update dependency brace-expansion@<2 to v2 [security]#752
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-brace-expansion-2-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
brace-expansion@<2 ~1.1.15~2.1.2 age confidence

brace-expansion: DoS via exponential-time expansion of consecutive non-expanding {} groups

CVE-2026-13149 / GHSA-3jxr-9vmj-r5cp

More information

Details

Summary

brace-expansion's expand() exhibits exponential-time - O(2ⁿ) - behavior in the number of consecutive non-expanding {} groups. A short, all-ASCII input (~90 bytes/30 groups) blocks the calling thread for minutes; a slightly longer input hangs it effectively indefinitely. Because the dominant consumers run on Node's single-threaded event loop, one small input can fully stall a worker/process.

In expand_, post is computed unconditionally at the top of the function, before the early-return branches that don't use it:

const post = m.post.length ? expand_(m.post, max, false) : [''];   // always recurses
  ...
if (!isSequence && !isOptions) {
  if (m.post.match(/,(?!,).*\}/)) {
    str = m.pre + '{' + m.body + escClose + m.post;
    return expand_(str, max, true); // restart — `post` discarded
  }
  return [str];
}

For input like a{},{},…, the first {} is non-expanding, so control reaches the {a},b} rewrite branch - but expand_ has already recursed into post over the entire remaining tail, only to throw the result away.
Each level therefore spawns two recursive expansions over essentially the same remaining work: T(n) = 2·T(n−1) ⇒ O(2ⁿ).

The max option does not mitigate this: max only bounds the output-building loops; neither the post recursion nor the rewrite recursion consults it.

Measured on 5.0.6:

groups (n) input bytes time
20 60 130 ms
24 72 1.9 s
26 78 7.8 s
30 (PoC) 90 ~2 min
Proof of concept
const { expand } = require('brace-expansion');
// 30 non-expanding groups, ~90 bytes — blocks for minutes:
expand('a{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}');
Impact

Any application that passes attacker-influenced strings to brace-expansion.expand() - directly or transitively via minimatch/glob brace patterns - can be driven into a multi-minute-to-indefinite CPU hang by a tiny request, denying service on that thread/process.

Remediation

Upgrade to a patched release. The fix:

  1. Defers computing post until after the early-return branches (and computes it locally in the $-suffix branch), so post is only expanded when a brace set actually expands and the value is used. This alone removes the exponential.
  2. Converts the {a},b} rewrite from recursion to an in-function loop, so a long run of rewrites cannot grow the call stack.

Verified: the PoC drops from ~2 min to 0.55 ms, 5,000 groups complete in ~344 ms, and output is identical to 5.0.6 across a behavioral-equivalence suite (sequences, padding, $-prefix, a{},b}c, {},a}b, x{{a,b}}y, etc.). Post-fix complexity is ~O(n²) on this input class - acceptable for the security fix; a linear rewrite can be a non-urgent follow-up.

If immediate upgrade isn't possible, avoid passing untrusted input to expand() / glob brace patterns, or run such expansion under a timeout/worker.

Severity

  • CVSS Score: 7.7 / 10 (High)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P/S:N/AU:Y/R:U/V:D/RE:M/U:Amber

References

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


Release Notes

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

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

Compare Source

v1.1.18

Compare Source

v1.1.17

Compare Source

v1.1.16

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.

@changeset-bot

changeset-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 92a938f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nx-cloud

nx-cloud Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 39be3d3

Command Status Duration Result
nx run-many -t build --no-agents ✅ Succeeded <1s View ↗
nx affected -t build lint test typecheck e2e-ci ✅ Succeeded 2m 13s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-11 15:42:19 UTC

@pkg-pr-new

pkg-pr-new Bot commented Aug 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

@forgerock/davinci-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/davinci-client@752

@forgerock/device-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/device-client@752

@forgerock/journey-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/journey-client@752

@forgerock/oidc-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/oidc-client@752

@forgerock/protect

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/protect@752

@forgerock/recognize

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/recognize@752

@forgerock/sdk-types

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-types@752

@forgerock/sdk-utilities

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-utilities@752

@forgerock/iframe-manager

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/iframe-manager@752

@forgerock/sdk-logger

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-logger@752

@forgerock/sdk-oidc

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-oidc@752

@forgerock/sdk-request-middleware

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-request-middleware@752

@forgerock/storage

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/storage@752

commit: 92a938f

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Deployed eb5e78a to https://ForgeRock.github.io/ping-javascript-sdk/pr-752/eb5e78adc3574d531ccde9ff2e1c8eb0ba4a0b2b branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🆕 New Packages

🆕 @forgerock/journey-client - 92.6 KB (new)
🆕 @forgerock/journey-client - 0.0 KB (new)
🆕 @forgerock/device-client - 10.0 KB (new)
🆕 @forgerock/device-client - 0.0 KB (new)

➖ No Changes

@forgerock/sdk-utilities - 18.6 KB
@forgerock/recognize - 4284.4 KB
@forgerock/sdk-request-middleware - 4.6 KB
@forgerock/iframe-manager - 3.2 KB
@forgerock/sdk-oidc - 5.7 KB
@forgerock/storage - 1.5 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/oidc-client - 35.4 KB
@forgerock/sdk-types - 9.1 KB
@forgerock/davinci-client - 56.7 KB
@forgerock/protect - 144.6 KB


15 packages analyzed • Baseline from latest main build

Legend

🆕 New package
🔺 Size increased
🔻 Size decreased
➖ No change

ℹ️ How bundle sizes are calculated
  • Current Size: Total gzipped size of all files in the package's dist directory
  • Baseline: Comparison against the latest build from the main branch
  • Files included: All build outputs except source maps and TypeScript build cache
  • Exclusions: .map, .tsbuildinfo, and .d.ts.map files

🔄 Updated automatically on each push to this PR

@codecov-commenter

codecov-commenter commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 23.94%. Comparing base (eafe277) to head (92a938f).
⚠️ Report is 102 commits behind head on main.

❌ Your project status has failed because the head coverage (23.94%) is below the target coverage (40.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #752      +/-   ##
==========================================
+ Coverage   18.07%   23.94%   +5.87%     
==========================================
  Files         155      162       +7     
  Lines       24398    25722    +1324     
  Branches     1203     1669     +466     
==========================================
+ Hits         4410     6160    +1750     
+ Misses      19988    19562     -426     

see 24 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-2-vulnerability branch from 79862ab to c4ebf62 Compare August 10, 2026 20:44
@renovate renovate Bot changed the title chore(deps): update dependency brace-expansion@<2 to v5 [security] chore(deps): update dependency brace-expansion@<2 to v2 [security] Aug 10, 2026
@renovate renovate Bot changed the title chore(deps): update dependency brace-expansion@<2 to v2 [security] chore(deps): update dependency brace-expansion@<2 to v5 [security] Aug 10, 2026
@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-2-vulnerability branch 2 times, most recently from c6238c4 to 3d2a0c3 Compare August 10, 2026 22:31
@renovate renovate Bot changed the title chore(deps): update dependency brace-expansion@<2 to v5 [security] chore(deps): update dependency brace-expansion@<2 to v2 [security] Aug 10, 2026
@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-2-vulnerability branch from 3d2a0c3 to a264d51 Compare August 11, 2026 13:50
@renovate renovate Bot changed the title chore(deps): update dependency brace-expansion@<2 to v2 [security] chore(deps): update dependency brace-expansion@<2 to v5 [security] Aug 11, 2026
@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-2-vulnerability branch from a264d51 to 52b0d63 Compare August 11, 2026 13:56
@renovate renovate Bot changed the title chore(deps): update dependency brace-expansion@<2 to v5 [security] chore(deps): update dependency brace-expansion@<2 to v2 [security] Aug 11, 2026
@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-2-vulnerability branch from 52b0d63 to 39be3d3 Compare August 11, 2026 15:25
@renovate renovate Bot changed the title chore(deps): update dependency brace-expansion@<2 to v2 [security] chore(deps): update dependency brace-expansion@<2 to v5 [security] Aug 11, 2026
@renovate renovate Bot changed the title chore(deps): update dependency brace-expansion@<2 to v5 [security] chore(deps): update dependency brace-expansion@<2 to v2 [security] Aug 11, 2026
@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-2-vulnerability branch from 39be3d3 to ebc5543 Compare August 11, 2026 15:31
@renovate renovate Bot changed the title chore(deps): update dependency brace-expansion@<2 to v2 [security] chore(deps): update dependency brace-expansion@<2 to v5 [security] Aug 11, 2026
@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-2-vulnerability branch from ebc5543 to 5f0b649 Compare August 11, 2026 15:33
@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-2-vulnerability branch from 5f0b649 to 92a938f Compare August 11, 2026 15:38
@renovate renovate Bot changed the title chore(deps): update dependency brace-expansion@<2 to v5 [security] chore(deps): update dependency brace-expansion@<2 to v2 [security] Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant