brace-expansion: DoS via uncontrolled recursion in parseCommaParts causing stack exhaustion
juliangruber brace-expansion
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| brace-expansion npm |
|
|
juliangruber brace-expansion
| Product | Affected | Fixed in |
|---|---|---|
| brace-expansion npm |
|
|
The brace-expansion library generates arbitrary strings containing a common prefix and suffix. Prior to 1.1.19, 2.1.5, 3.0.7, and 5.0.10, crafted brace patterns can exhaust the native stack in parseCommaParts because parseCommaParts recursively processes the remainder once per brace group and uses push.apply to pass every element of a very large comma-part array as a function argument. Patterns containing many comma-separated brace groups trigger the recursive path, while the large array triggers the argument-array path without deep recursion. These paths cause recursive and argument-array native stack exhaustion before max or maxLength can limit output, potentially terminating the Node.js process in a process-terminating denial of service. This issue is fixed in versions 1.1.19, 2.1.5, 3.0.7, and 5.0.10.
From the CVE record · GitHub_M
Affected brace-expansion versions can exhaust the native stack while parsing crafted brace patterns. If an attacker can cause a Node.js process to parse such a pattern, the process may terminate; the input does not specify network access or authentication requirements.
Check applications using npm brace-expansion versions before 1.1.19, from 2.0.0 to before 2.1.5, from 3.0.0 to before 3.0.7, or from 4.0.0 to before 5.0.10.