All vulnerabilities

npm

CVE-2026-102278

brace-expansion: DoS via uncontrolled recursion on nested brace groups causing stack exhaustion

Severity
High 7.5
Published
29 Sept 2026
Last changed
30 Sept 2026
Added to UpHeron
22 Oct 2026
Fixed in
1.1.20, 2.1.6, 3.0.8, 5.0.11
Exploit chance
0.5% in the next 30 daysHigher than 42% of CVEs. EPSS by FIRST, 19 Nov 2026
Weakness
Uncontrolled resource consumption (CWE-400)Uncontrolled recursion (CWE-674)
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-qhr7-859c-m2p7
Sources
OSV.dev and GitHub

Description

expand_() recurses once per level of brace nesting. Deeply nested input exhausts the native stack and crashes the process.

This is distinct from CVE-2026-14257 / GHSA-mh99-v99m-4gvg, which made the tail iterative (recursion on m.post, driven by how many groups are chained). Nesting depth drives a different recursion that the tail fix never touched, so the documented constant-stack-depth guarantee only ever covered chained input, not nested input.

It is also distinct from GHSA-6j4f-fj2g-mc7p, which fixed recursion in parseCommaParts(). Both payloads below still crash with that fix applied.

Comma members. Each alternative of a brace set is expanded by a recursive call, so nesting a set inside every alternative recurses once per level:

Crashes at depth 3,907 - about 15.6 KB of input.

Single set. A brace set whose body parses to a single part is expanded by a recursive call before being re-wrapped (x{{a,b}}y -> x{a}y x{b}y), which recurses once per nesting level:

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.20
  • From 2.0.0 before 2.1.6
  • From 3.0.0 before 3.0.8
  • From 4.0.0 before 5.0.11

About brace-expansion

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

References