npm
CVE-2026-102277
brace-expansion: Quadratic-time expansion of the `{a},b}` rewrite causes CPU denial of service
- Severity
- Medium 5.3
- Published
- 29 Sept 2026
- Last changed
- 30 Sept 2026
- Added to UpHeron
- 22 Oct 2026
- Fixed in
- 1.1.21, 2.1.7, 3.0.9, 5.0.12
- Exploit chance
- 0.4% in the next 30 daysHigher than 37% 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-q2hr-2g5m-vwhr
- Sources
- OSV.dev and GitHub
Description
Expanding {a},b}-shaped input takes time quadratic in the number of literal } characters, blocking the event loop.
Bash preserves a quirk where a brace group followed by a comma set still expands ({a},b}). The parser implements this by rewriting the string and restarting the scan. Each pass absorbs exactly one } and re-scans from the beginning, so n trailing braces cost n full passes.
Instrumenting the rewrite branch confirms it runs exactly n + 1 times, once per literal }, each re-scanning the whole string.
There is a second multiplier. The rewrite replaces the group's closing } with the internal escClose sentinel, which is '\0CLOSE' + Math.random() + '\0' - about 25 characters. The working string therefore grows by ~25 characters on every pass:
So the input is inflated roughly 26x, and that factor multiplies both the quadratic constant and peak memory. This makes it partly a memory-pressure issue as well as a CPU one.
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-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-13149brace-expansion: DoS via exponential-time expansion of consecutive non-expanding {} groupsHigh 5.3 20 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-102277
- GitHub Advisory Database https://github.com/advisories/GHSA-q2hr-2g5m-vwhr