---
title: "GHSA-f886-m6hf-6m8v: brace-expansion: Zero-step sequence causes process hang and memory exhaustion"
description: "Moderate severity. brace-expansion: Zero-step sequence causes process hang and memory exhaustion. Affects brace-expansion; fixed in 5.0.5."
url: https://inlinr.com/advisories/GHSA-f886-m6hf-6m8v
lang: en
---

[Packages](https://inlinr.com/packages) / [brace-expansion](https://inlinr.com/packages/brace-expansion) / [Security](https://inlinr.com/packages/brace-expansion/security)

Moderate Vulnerability GHSA-f886-m6hf-6m8v CVE-2026-33750 Published 26 Mar 2026

# brace-expansion: Zero-step sequence causes process hang and memory exhaustion

Your version 

Affected releases · [brace-expansion](https://inlinr.com/packages/brace-expansion)

- 5.x 5.0.2 – 5.0.4 Fixed in 5.0.5
- 4.x 4.0.0 – 4.0.1 No fix on this line yet
- 3.x 3.0.0 – 3.0.1 Fixed in 3.0.2
- 2.x 2.0.0 – 2.0.2 Fixed in 2.0.3
- 1.x 1.0.0 – 1.1.12 Fixed in 1.1.13
- 0.0.x 0.0.0 No fix on this line yet

On 5.x, the newest line:

```
npm install brace-expansion@5.0.5
```

Every release on a timeline

5.x 

1. Affected

5.0.2 – 5.0.4  
3 releases
2. Fixed

5.0.5 – 5.0.13  
9 releases, latest

4.x 

1. Affected

4.0.0 – 4.0.1  
2 releases

3.x 

1. Affected

3.0.0 – 3.0.1  
2 releases
2. Fixed

3.0.2 – 3.0.10  
9 releases

2.x 

1. Affected

2.0.0 – 2.0.2  
3 releases
2. Fixed

2.0.3 – 2.1.8  
10 releases

1.x 

1. Affected

1.0.0 – 1.1.12  
15 releases
2. Fixed

1.1.13 – 1.1.22  
10 releases

0.x 

1. Affected

0.0.0  
1 release

64 stable releases of brace-expansion, oldest to newest, one row per major.

## What happens

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:

[github.com/juliangruber/brace-expansion/blob/da…](https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L184 "https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L184")

`test()` is one of

[github.com/juliangruber/brace-expansion/blob/da…](https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L107-L113 "https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L107-L113")

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.

## How it is exploited

Exploitable over the network, with no account and a user to do something.

- **Confidentiality**: none
- **Integrity**: none
- **Availability**: high

CVSS:3.1/​AV:N/​AC:L/​PR:N/​UI:R/​S:U/​C:N/​I:N/​A:H

## References

- [Reference](https://github.com/juliangruber/brace-expansion/security/advisories/GHSA-f886-m6hf-6m8v "https://github.com/juliangruber/brace-expansion/security/advisories/GHSA-f886-m6hf-6m8v")  
github.com/juliangruber/brace-expansion/securit…
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-33750 "https://nvd.nist.gov/vuln/detail/CVE-2026-33750")  
nvd.nist.gov/vuln/detail/CVE-2026-33750
- [Issue](https://github.com/juliangruber/brace-expansion/issues/98 "https://github.com/juliangruber/brace-expansion/issues/98")  
#98
- [Pull request](https://github.com/juliangruber/brace-expansion/pull/95 "https://github.com/juliangruber/brace-expansion/pull/95")  
#95
- [Pull request](https://github.com/juliangruber/brace-expansion/pull/96 "https://github.com/juliangruber/brace-expansion/pull/96")  
#96
- [Pull request](https://github.com/juliangruber/brace-expansion/pull/97 "https://github.com/juliangruber/brace-expansion/pull/97")  
#97
- [Fix commit](https://github.com/juliangruber/brace-expansion/commit/311ac0d54994158c0a384e286a7d6cbb17ee8ed5 "https://github.com/juliangruber/brace-expansion/commit/311ac0d54994158c0a384e286a7d6cbb17ee8ed5")  
311ac0d
- [Fix commit](https://github.com/juliangruber/brace-expansion/commit/7fd684f89fdde3549563d0a6522226a9189472a2 "https://github.com/juliangruber/brace-expansion/commit/7fd684f89fdde3549563d0a6522226a9189472a2")  
7fd684f
- [Fix commit](https://github.com/juliangruber/brace-expansion/commit/b9cacd9e55e7a1fa588fe4b7bb1159d52f1d902a "https://github.com/juliangruber/brace-expansion/commit/b9cacd9e55e7a1fa588fe4b7bb1159d52f1d902a")  
b9cacd9
- [Package](https://github.com/juliangruber/brace-expansion "https://github.com/juliangruber/brace-expansion")  
github.com/juliangruber/brace-expansion
- [Reference](https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L107-L113 "https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L107-L113")  
github.com/juliangruber/brace-expansion/blob/da…
- [Reference](https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L184 "https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L184")  
github.com/juliangruber/brace-expansion/blob/da…

A whole project to check? Paste its package.json in the [dependency check](https://inlinr.com/tools/dependency-check): every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.
