CVE-2026-33750: brace-expansion Zero-step Sequence Causes Process Hang Vulnerability

MODERATE
Advisory Identifier: GHSA-f886-m6hf-6m8v
CVSS 6.5
CWE-400
Published
Advisory Summary

CVE-2026-33750 is a MODERATE (CVSS 6.5) zero-step sequence causes process hang vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting brace-expansion libraries in the npm ecosystem. The issue involves zero-step sequence causes process hang and memory exhaustion. Remediation is available by upgrading affected packages to version 5.0.5, 3.0.2, 2.0.3, 1.1.13.

CVE-2026-33750 at a Glance

CVE Identifier CVE-2026-33750
GHSA Identifier GHSA-f886-m6hf-6m8v
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product brace-expansion
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-33750

To remediate this vulnerability, upgrade all affected brace-expansion dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

brace-expansion fixed: 5.0.5
npm install brace-expansion@5.0.5
brace-expansion fixed: 3.0.2
npm install brace-expansion@3.0.2
brace-expansion fixed: 2.0.3
npm install brace-expansion@2.0.3
brace-expansion fixed: 1.1.13
npm install brace-expansion@1.1.13
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls brace-expansion

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-33750, inspect your project dependencies using npm:

npm ls brace-expansion

Analyze the terminal output to locate any version of brace-expansion in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.0.5), your application is affected.

Note: The npm ls brace-expansion command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In brace-expansion, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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: https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L184 `test()` is one of 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.

CVE-2026-33750 Affected brace-expansion Versions

4 component(s)
Fixed Versions:
5.0.53.0.22.0.31.1.13
Product / Package Ecosystem Affected Versions Fixed Version
brace-expansion
npm
≥ 4.0.0
< 5.0.5
5.0.5
brace-expansion
npm
≥ 3.0.0
< 3.0.2
3.0.2
brace-expansion
npm
≥ 2.0.0
< 2.0.3
2.0.3
brace-expansion
npm
< 1.1.13
1.1.13

References

Frequently Asked Questions

What is CVE-2026-33750?
CVE-2026-33750 is a security vulnerability in brace-expansion involving Zero-step sequence causes process hang and memory exhaustion under CWE-400: Uncontrolled Resource Consumption.
Which brace-expansion versions are affected?
Affected versions include releases prior to 5.0.5, 3.0.2, 2.0.3, 1.1.13 across affected packages: brace-expansion.
What version fixes CVE-2026-33750?
Upgrading to 5.0.5, 3.0.2, 2.0.3, 1.1.13 (or the latest patched release for your respective branch) resolves the vulnerability.
Is brace-expansion affected?
Yes, brace-expansion is affected in releases prior to 5.0.5, 3.0.2, 2.0.3, 1.1.13. Upgrade your dependency to 5.0.5, 3.0.2, 2.0.3, 1.1.13 or later.
What is the CVSS score of CVE-2026-33750?
CVE-2026-33750 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-33750?
CVE-2026-33750 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for CVE-2026-33750?
Run the dependency tree command: 'npm ls brace-expansion'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f886-m6hf-6m8v",
  "modified" : "2026-03-27T21:38:55Z",
  "published" : "2026-03-26T18:29:42Z",
  "aliases" : [ "CVE-2026-33750" ],
  "summary" : "brace-expansion: Zero-step sequence causes process hang and memory exhaustion",
  "details" : "### Impact\n\nA 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.\n\nThe loop in question:\n\nhttps://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L184\n\n`test()` is one of\n\nhttps://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L107-L113\n\nThe 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.\n\nThis 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.\n\n### Patches\n\n\nUpgrade to versions\n- 5.0.5+\n\nA step increment of 0 is now sanitized to 1, which matches bash behavior.\n\n### Workarounds\n\nSanitize strings passed to `expand()` to ensure a step value of `0` is not used.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "brace-expansion"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "5.0.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "brace-expansion"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.0.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "brace-expansion"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "brace-expansion"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.13"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/juliangruber/brace-expansion/security/advisories/GHSA-f886-m6hf-6m8v"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33750"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juliangruber/brace-expansion/issues/98"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juliangruber/brace-expansion/pull/95"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juliangruber/brace-expansion/pull/96"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juliangruber/brace-expansion/pull/97"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juliangruber/brace-expansion/commit/311ac0d54994158c0a384e286a7d6cbb17ee8ed5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juliangruber/brace-expansion/commit/7fd684f89fdde3549563d0a6522226a9189472a2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juliangruber/brace-expansion/commit/b9cacd9e55e7a1fa588fe4b7bb1159d52f1d902a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/juliangruber/brace-expansion"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L107-L113"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L184"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-26T18:29:42Z",
    "nvd_published_at" : "2026-03-27T15:16:57Z"
  }
}