CVE-2026-14257: brace-expansion: DoS via unbounded expansion length causing an out-of-memory process crash
(updated )
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.
References
- github.com/advisories/GHSA-mh99-v99m-4gvg
- github.com/juliangruber/brace-expansion
- github.com/juliangruber/brace-expansion/commit/139d015104e71433ad52a41d19467c48ecbb2c7d
- github.com/juliangruber/brace-expansion/commit/a1bd33999ea75262c4749fff3bbb0d1372bd07b5
- github.com/juliangruber/brace-expansion/commit/cb4b9e47cc2ec777c14b2b4492fb431a56f6a031
- github.com/juliangruber/brace-expansion/commit/d13ff455a58b0d56704f0111e3c2a0b16ceb06eb
- github.com/juliangruber/brace-expansion/pull/129
- github.com/juliangruber/brace-expansion/pull/130
- github.com/juliangruber/brace-expansion/pull/136
- github.com/juliangruber/brace-expansion/security/advisories/GHSA-mh99-v99m-4gvg
- nvd.nist.gov/vuln/detail/CVE-2026-14257
- www.npmjs.com/package/brace-expansion
Code Behaviors & Features
Detect and mitigate CVE-2026-14257 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →