NodeJS/brace-expansion/1.1.11
Brace expansion as known from sh/bash
https://www.npmjs.com/package/brace-expansion
MIT
2 Security Vulnerabilities
brace-expansion: Zero-step sequence causes process hang and memory exhaustion
- https://github.com/juliangruber/brace-expansion/security/advisories/GHSA-f886-m6hf-6m8v
- https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L107-L113
- https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L184
- https://github.com/advisories/GHSA-f886-m6hf-6m8v
- https://github.com/juliangruber/brace-expansion/issues/98
- https://github.com/juliangruber/brace-expansion/pull/95
- https://github.com/juliangruber/brace-expansion/pull/96
- https://github.com/juliangruber/brace-expansion/pull/97
- https://github.com/juliangruber/brace-expansion/commit/311ac0d54994158c0a384e286a7d6cbb17ee8ed5
- https://github.com/juliangruber/brace-expansion/commit/7fd684f89fdde3549563d0a6522226a9189472a2
- https://github.com/juliangruber/brace-expansion/commit/b9cacd9e55e7a1fa588fe4b7bb1159d52f1d902a
- https://nvd.nist.gov/vuln/detail/CVE-2026-33750
Impact
A brace pattern with a zero step value (e.g., {1..2..0}) causes the sequence generation loop to run indefinitely, making the process hang for seconds and allocate heaps of memory.
The loop in question:
test() is one of
The increment is computed as Math.abs(0) = 0, so the loop variable never advances. On a test machine, the process hangs for about 3.5 seconds and allocates roughly 1.9 GB of memory before throwing a RangeError. Setting max to any value has no effect because the limit is only checked at the output combination step, not during sequence generation.
This affects any application that passes untrusted strings to expand(), or by error sets a step value of 0. That includes tools built on minimatch/glob that resolve patterns from CLI arguments or config files. The input needed is just 10 bytes.
Patches
Upgrade to versions - 5.0.5+
A step increment of 0 is now sanitized to 1, which matches bash behavior.
Workarounds
Sanitize strings passed to expand() to ensure a step value of 0 is not used.
brace-expansion Regular Expression Denial of Service vulnerability
- https://nvd.nist.gov/vuln/detail/CVE-2025-5889
- https://github.com/juliangruber/brace-expansion/pull/65/commits/a5b98a4f30d7813266b221435e1eaaf25a1b0ac5
- https://gist.github.com/mmmsssttt404/37a40ce7d6e5ca604858fe30814d9466
- https://vuldb.com/?ctiid.311660
- https://vuldb.com/?id.311660
- https://vuldb.com/?submit.585717
- https://github.com/juliangruber/brace-expansion/commit/0b6a9781e18e9d2769bb2931f4856d1360243ed2
- https://github.com/juliangruber/brace-expansion/commit/15f9b3c75ebf5988198241fecaebdc45eff28a9f
- https://github.com/juliangruber/brace-expansion/commit/36603d5f3599a37af9e85eda30acd7d28599c36e
- https://github.com/juliangruber/brace-expansion/commit/c3c73c8b088defc70851843be88ccc3af08e7217
- https://github.com/advisories/GHSA-v6h2-p8h4-qcjw
A vulnerability was found in juliangruber brace-expansion up to 1.1.11/2.0.1/3.0.0/4.0.0. It has been rated as problematic. Affected by this issue is the function expand of the file index.js. The manipulation leads to inefficient regular expression complexity. The attack may be launched remotely. The complexity of an attack is rather high. The exploitation is known to be difficult. The exploit has been disclosed to the public and may be used. Upgrading to version 1.1.12, 2.0.2, 3.0.1 and 4.0.1 is able to address this issue. The name of the patch is a5b98a4f30d7813266b221435e1eaaf25a1b0ac5. It is recommended to upgrade the affected component.
30 Other Versions
| Version | License | Security | Released | |
|---|---|---|---|---|
| 5.0.5 | MIT | 2026-03-24 - 17:58 | 10 days | |
| 5.0.4 | MIT | 1 | 2026-02-27 - 09:37 | about 1 month |
| 5.0.3 | MIT | 1 | 2026-02-22 - 11:37 | about 1 month |
| 5.0.2 | MIT | 1 | 2026-02-12 - 08:18 | about 2 months |
| 4.0.1 | MIT | 1 | 2025-06-11 - 07:04 | 10 months |
| 4.0.0 | MIT | 2 | 2024-02-27 - 11:56 | about 2 years |
| 3.0.2 | MIT | 2026-03-27 - 08:41 | 7 days | |
| 3.0.1 | MIT | 1 | 2025-06-11 - 08:44 | 10 months |
| 3.0.0 | MIT | 2 | 2023-10-07 - 13:31 | over 2 years |
| 2.0.3 | MIT | 2026-03-27 - 08:40 | 7 days | |
| 2.0.2 | MIT | 1 | 2025-06-11 - 08:48 | 10 months |
| 2.0.1 | MIT | 2 | 2021-02-22 - 16:18 | about 5 years |
| 2.0.0 | MIT | 2 | 2020-10-05 - 11:41 | over 5 years |
| 1.1.13 | MIT | 2026-03-27 - 08:39 | 7 days | |
| 1.1.12 | MIT | 1 | 2025-06-11 - 08:52 | 10 months |
| 1.1.11 | MIT | 2 | 2018-02-10 - 07:42 | about 8 years |
| 1.1.10 | MIT | 2 | 2018-02-09 - 21:13 | about 8 years |
| 1.1.9 | MIT | 2 | 2018-02-09 - 09:53 | about 8 years |
| 1.1.8 | MIT | 2 | 2017-06-12 - 07:19 | almost 9 years |
| 1.1.7 | MIT | 2 | 2017-04-07 - 08:13 | almost 9 years |
| 1.1.6 | MIT | 4 | 2016-07-20 - 20:48 | over 9 years |
| 1.1.5 | MIT | 4 | 2016-06-15 - 11:21 | almost 10 years |
| 1.1.4 | MIT | 4 | 2016-05-01 - 19:14 | almost 10 years |
| 1.1.3 | MIT | 4 | 2016-02-11 - 18:51 | about 10 years |
| 1.1.2 | MIT | 4 | 2015-11-28 - 12:58 | over 10 years |
| 1.1.1 | MIT | 4 | 2015-09-27 - 21:58 | over 10 years |
| 1.1.0 | MIT | 4 | 2014-12-16 - 18:58 | over 11 years |
| 1.0.1 | MIT | 4 | 2014-12-03 - 07:58 | over 11 years |
| 1.0.0 | MIT | 4 | 2014-11-30 - 09:58 | over 11 years |
| 0.0.0 | MIT | 3 | 2013-10-13 - 12:58 | over 12 years |
