All vulnerabilities

npm

CVE-2026-45149

brace-expansion: Large numeric range defeats documented `max` DoS protection

Severity
Medium 6.5
Published
18 May 2026
Last changed
10 Sept 2026
Added to UpHeron
22 Oct 2026
Fixed in
5.0.6
Exploit chance
0.3% in the next 30 daysHigher than 23% of CVEs. EPSS by FIRST, 19 Nov 2026
Weakness
Uncontrolled resource consumption (CWE-400)
Attack
Over the network · No login needed · Needs someone to click or open something
Attacker can
Take it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Also known as
GHSA-jxxr-4gwj-5jf2
Sources
OSV.dev and GitHub

Description

The max option was being applied too late:

When expanding a single large numeric range like {1..10000000}, the sequence generation loop generates all 10 million intermediate elements before the max limit is applied With max=10, the output is correctly limited to 10 items, but the process still allocates ~505 MB and spends ~800ms building the full intermediate array.

From the GitHub Advisory Database, CC BY 4.0.

Workarounds

Ensure the string to be expanded doesn't contain more values than the desired max item count.

Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
brace-expansionnpm · osv:npm:brace-expansion
  • From 5.0.0 before 5.0.6

About brace-expansion

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

References