Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
MEDIUM severity

brace-expansion: DoS via exponential-time expansion of consecutive non-expanding {} groupsGHSA-3jxr-9vmj-r5cp

MEDIUMFix: juliangruber/brace-expansion#122

GHSA-3jxr-9vmj-r5cp is a medium-severity (CVSS 5.3) Uncontrolled Resource Consumption vulnerability in brace-expansion. A fix is available for brace-expansion — see the affected versions and patch details below.

Also known asCVE-2026-13149
Published
Updated
Affected
3 pkgs
Patched
3 / 3
Exploits
None indexed
Exploitation data as of Oct 10, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
  • CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for GHSA-3jxr-9vmj-r5cp.

EPSS Exploitation Probability

via FIRST.org ↗
0.4%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs28th percentile — riskier than 28% of all scored CVEsHighest risk
0.00%0.29%0.58%0.86%0.4%0.3%0.4%0.4%0.4%Jul 26Sep 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

GHSA-3jxr-9vmj-r5cp by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 385,738 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

3 pkgs affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

3Kother npm packages depend on this — each one inherits the vulnerability until it's patched upstream
brace-expansionnpm
634.4Mdownloads / week

Description

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 bytestime
2060130 ms
24721.9 s
26787.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.

Affected Packages

3 total 3 fixed
EcosystemPackageVulnerable rangeFix
📦npmbrace-expansion≥ 3.0.0&&< 5.0.75.0.7npm install brace-expansion@5.0.7
📦npmbrace-expansionall versions1.1.16npm install brace-expansion@1.1.16
📦npmbrace-expansion≥ 2.0.0&&< 2.1.22.1.2npm install brace-expansion@2.1.2

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for brace-expansion, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update brace-expansion to 5.0.7 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-3jxr-9vmj-r5cp is resolved across your whole dependency graph.

  3. Workarounds

    Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.

Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatImportant

A flaw was found in brace-expansion, a widely-used npm package for expanding brace sequences. The expand() function exhibits exponential-time complexity when processing consecutive non-expanding brace groups. An attacker who can supply crafted input to expand(), directly or transitively via minimatch or glob, can…

Workaround published by Red Hat
There is no practical mitigation for this vulnerability. The brace-expansion package is typically a transitive dependency pulled in via minimatch and glob, making it difficult to isolate. Users should upgrade to a fixed version of brace-expansion when one becomes available.
Source: Red Hat security advisory for GHSA-3jxr-9vmj-r5cp (CC BY 4.0)
ProductFixed inAdvisory
Cryostat 4 on RHEL 9cryostat/cryostat-grafana-dashboard-rhel9:4.2.0-13RHSA-2026:48151
Red Hat AMQ Broker 7.13.6brace-expansionRHSA-2026:66545
Red Hat AMQ Broker 7.14.1brace-expansionRHSA-2026:66488
Red Hat Enterprise Linux 10nodejs-nodemon-0:3.1.14-2.el10_2RHSA-2026:48032
Red Hat Enterprise Linux 10nodejs22-1:22.23.1-4.el10_2RHSA-2026:48033
Red Hat Enterprise Linux 10nodejs24-1:24.18.0-3.el10_2RHSA-2026:48034
Red Hat Enterprise Linux 10rh-podman-desktop-0:1.1.2-1.el10_2RHSA-2026:57590
Red Hat Enterprise Linux 10.0 Extended Update Supportnodejs-nodemon-0:3.1.14-2.el10_0RHSA-2026:52394

Frequently Asked Questions

### 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: ```js const post = m.post.length ? expand_(m.post, max, false) :
O3 Security · Impact-Aware SCA

Is GHSA-3jxr-9vmj-r5cp in your dependencies?

Find it across npm, including transitive dependencies.

brace-expansion: DoS via exponential-time expansion of…