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
- 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.
Affected software
| Software | Affected versions |
|---|---|
brace-expansionnpm · osv:npm:brace-expansion |
|
About brace-expansion
- Weekly downloads (npm)
- 838,345,228npm, 16 Nov 2026
Vulnerabilities in brace-expansion
- In our list
- 7
- Published in the last 12 months
- 7
- Critical, last 12 months
- 0
- High, last 12 months
- 5
- Known exploited
- 0
- CVE-2026-102277brace-expansion: Quadratic-time expansion of the `{a},b}` rewrite causes CPU denial of serviceMedium 5.3 29 Sept 2026
- CVE-2026-102278brace-expansion: DoS via uncontrolled recursion on nested brace groups causing stack exhaustionHigh 7.5 29 Sept 2026
- CVE-2026-102276brace-expansion: DoS via uncontrolled recursion in parseCommaParts causing stack exhaustionHigh 7.5 29 Sept 2026
- CVE-2026-69152brace-expansion: DoS via unbounded intermediate arrays, bypassing the CVE-2026-14257 mitigationHigh 7.5 3 Aug 2026
- CVE-2026-14257brace-expansion: DoS via unbounded expansion length causing an out-of-memory process crashHigh 7.5 24 Jul 2026
- CVE-2026-45149brace-expansion: Large numeric range defeats documented `max` DoS protectionMedium 6.5 18 May 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-13149
- GitHub Advisory Database https://github.com/advisories/GHSA-3jxr-9vmj-r5cp