Skip to content

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

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]#840
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-brace-expansion-2-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Sep 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 Sep 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 15233bd

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

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 7bbe2182-1a8a-4e47-a71e-4f612e47a670

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit b076717

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 34s View ↗

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


☁️ Nx Cloud last updated this comment at 2026-09-11 22:14:00 UTC

@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-2-vulnerability branch from 96253f9 to e923cac Compare September 10, 2026 21:11
@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] Sep 10, 2026
nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-2-vulnerability branch from e923cac to e553f2e Compare September 11, 2026 19:47
@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] Sep 11, 2026
nx-cloud[bot]

This comment was marked as outdated.

@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-2-vulnerability branch from e553f2e to a56e82f Compare September 11, 2026 20:02
@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] Sep 11, 2026
nx-cloud[bot]

This comment was marked as outdated.

@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-2-vulnerability branch from a56e82f to a5c223c Compare September 11, 2026 20:10
@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] Sep 11, 2026
@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-2-vulnerability branch from a5c223c to d9bfaa9 Compare September 11, 2026 20:12
@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] Sep 11, 2026
nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-2-vulnerability branch from d9bfaa9 to ca7a638 Compare September 11, 2026 21:10
@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] Sep 11, 2026
@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-2-vulnerability branch from ca7a638 to 2a610d4 Compare September 11, 2026 21:12
@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] Sep 11, 2026

@nx-cloud nx-cloud Bot 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.

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud has identified a possible root cause for your failed CI:

We classified this failure as an environment issue rather than a code change. The PR only updates a transitive tooling dependency (brace-expansion), which has no runtime relationship to the PingOne Protect risk assessment API. The test reached the "Evaluating risk assessment..." step successfully but timed out waiting for the service to return a completion result, pointing to a transient external service availability issue in this CI run.

No code changes were suggested for this issue.

Trigger a rerun:

Rerun CI

Nx Cloud View detailed reasoning on Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

@pkg-pr-new

pkg-pr-new Bot commented Sep 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

@forgerock/davinci-client

pnpm add https://pkg.pr.new/@forgerock/davinci-client@840

@forgerock/device-client

pnpm add https://pkg.pr.new/@forgerock/device-client@840

@forgerock/journey-client

pnpm add https://pkg.pr.new/@forgerock/journey-client@840

@forgerock/oidc-client

pnpm add https://pkg.pr.new/@forgerock/oidc-client@840

@forgerock/protect

pnpm add https://pkg.pr.new/@forgerock/protect@840

@forgerock/sdk-types

pnpm add https://pkg.pr.new/@forgerock/sdk-types@840

@forgerock/sdk-utilities

pnpm add https://pkg.pr.new/@forgerock/sdk-utilities@840

@forgerock/iframe-manager

pnpm add https://pkg.pr.new/@forgerock/iframe-manager@840

@forgerock/sdk-logger

pnpm add https://pkg.pr.new/@forgerock/sdk-logger@840

@forgerock/sdk-oidc

pnpm add https://pkg.pr.new/@forgerock/sdk-oidc@840

@forgerock/sdk-request-middleware

pnpm add https://pkg.pr.new/@forgerock/sdk-request-middleware@840

@forgerock/storage

pnpm add https://pkg.pr.new/@forgerock/storage@840

commit: 15233bd

@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Deployed efc5710 to https://ForgeRock.github.io/ping-javascript-sdk/pr-840/efc5710eee9be0f9b36422b958aa9ecb32cec6a1 branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions

Copy link
Copy Markdown
Contributor

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🆕 New Packages

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

📊 Minor Changes

📈 @forgerock/sdk-types - 9.1 KB (+0.0 KB)

➖ No Changes

@forgerock/recognize - 4284.4 KB
@forgerock/oidc-client - 35.5 KB
@forgerock/storage - 1.5 KB
@forgerock/iframe-manager - 3.2 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/sdk-oidc - 5.7 KB
@forgerock/sdk-request-middleware - 4.6 KB
@forgerock/sdk-utilities - 18.8 KB
@forgerock/protect - 144.6 KB
@forgerock/davinci-client - 59.7 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 Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.29%. Comparing base (eafe277) to head (15233bd).
⚠️ Report is 149 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #840       +/-   ##
===========================================
+ Coverage   18.07%   96.29%   +78.22%     
===========================================
  Files         155        1      -154     
  Lines       24398       81    -24317     
  Branches     1203       17     -1186     
===========================================
- Hits         4410       78     -4332     
+ Misses      19988        3    -19985     

see 155 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 2a610d4 to 175a31f Compare September 11, 2026 21:34
@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] Sep 11, 2026
@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-2-vulnerability branch from 175a31f to 13a7ade Compare September 11, 2026 21:36
@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] Sep 11, 2026
@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-2-vulnerability branch from 13a7ade to b076717 Compare September 11, 2026 22:07
@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] Sep 11, 2026
@renovate
renovate Bot force-pushed the renovate/npm-brace-expansion-2-vulnerability branch from b076717 to 15233bd Compare September 11, 2026 22:09
@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] Sep 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