All vulnerabilities

npm

CVE-2026-14257

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

Severity
High 7.5
Published
24 Jul 2026
Last changed
10 Sept 2026
Added to UpHeron
22 Oct 2026
Fixed in
1.1.17, 2.1.3, 3.0.3, 5.0.8
Exploit chance
0.6% in the next 30 daysHigher than 51% of CVEs. EPSS by FIRST, 19 Nov 2026
Weakness
Uncontrolled resource consumption (CWE-400)Allocation without limits (CWE-770)
Attack
Over the network · No login needed · No user action needed
Attacker can
Take it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Also known as
GHSA-mh99-v99m-4gvg
Sources
OSV.dev and GitHub

Description

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.

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:

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.17
  • From 2.0.0 before 2.1.3
  • From 3.0.0 before 3.0.3
  • From 4.0.0 before 5.0.8

About brace-expansion

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

References