CVE-2026-102278: brace-expansion: DoS via uncontrolled recursion on nested brace groups causing stack exhaustion
The brace-expansion library generates arbitrary strings containing a common prefix and suffix. Prior to 1.1.20, 2.1.6, 3.0.8, and 5.0.11, deeply nested brace groups cause expand() to recurse once per nesting level at comma-member and single-set expansion sites, exhausting the native stack before output limits can apply and potentially terminating the Node.js process. expand performs uncontrolled recursion for nested brace alternatives and single-part sets. deeply nested brace groups supplied as an untrusted pattern. expand is affected. expand is affected. Comma members is affected. Single set is affected. native stack exhaustion during nested sub-expansion. process-terminating denial of service. This issue is fixed in versions 1.1.20, 2.1.6, 3.0.8, and 5.0.11.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
brace-expansionto a version that resolves this vulnerability.Fixed in 1.1.20 - Upgrade
Upgrade
brace-expansionto a version that resolves this vulnerability.Fixed in 2.1.6 - Upgrade
Upgrade
brace-expansionto a version that resolves this vulnerability.Fixed in 3.0.8 - Upgrade
Upgrade
brace-expansionto a version that resolves this vulnerability.Fixed in 5.0.11
Event History
Frequently Asked Questions
Which applications are realistically exposed to this issue?
Applications using npm/brace-expansion are exposed when they pass untrusted patterns into brace expansion. The vulnerable paths include nested brace alternatives, comma members, and single-part sets processed by expand_ or expand.
What must an attacker provide to trigger the denial of service?
An attacker needs to supply a deeply nested brace-group pattern to a reachable brace-expansion call. No privileges or user interaction are required according to the supplied severity vector.
Does limiting expansion output prevent this issue?
No. The recursion occurs once per nesting level during nested sub-expansion and can exhaust the native stack before output limits apply.
What versions resolve the issue?
Upgrade to brace-expansion 1.1.20, 2.1.6, 3.0.8, or 5.0.11, as applicable to the version line in use.