All vulnerabilities

npm

CVE-2026-13149

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

Severity
High 5.3
Published
20 Jul 2026
Last changed
10 Sept 2026
Added to UpHeron
22 Oct 2026
Fixed in
1.1.16, 2.1.2, 5.0.7
Exploit chance
0.4% in the next 30 daysHigher than 30% of CVEs. EPSS by FIRST, 19 Nov 2026
Weakness
Uncontrolled resource consumption (CWE-400)Inefficient algorithmic complexity (CWE-407)
Attack
Over the network · No login needed · No user action needed
Attacker can
Slow it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Also known as
GHSA-3jxr-9vmj-r5cp
Sources
OSV.dev and GitHub

Description

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:

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.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
brace-expansionnpm · osv:npm:brace-expansion
  • Every version before 1.1.16
  • From 2.0.0 before 2.1.2
  • From 3.0.0 before 5.0.7

About brace-expansion

Weekly downloads (npm)
838,345,228npm, 16 Nov 2026

References