GHSA-7h2j-956f-4vf2

Suggest an improvement
Source
https://github.com/advisories/GHSA-7h2j-956f-4vf2
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/02/GHSA-7h2j-956f-4vf2/GHSA-7h2j-956f-4vf2.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-7h2j-956f-4vf2
Aliases
Downstream
Related
Published
2026-02-03T19:41:15Z
Modified
2026-02-05T18:13:52.919282Z
Severity
  • 8.7 (High) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N CVSS Calculator
Summary
@isaacs/brace-expansion has Uncontrolled Resource Consumption
Details

Summary

@isaacs/brace-expansion is vulnerable to a Denial of Service (DoS) issue caused by unbounded brace range expansion. When an attacker provides a pattern containing repeated numeric brace ranges, the library attempts to eagerly generate every possible combination synchronously. Because the expansion grows exponentially, even a small input can consume excessive CPU and memory and may crash the Node.js process.

Details

The vulnerability occurs because @isaacs/brace-expansion expands brace expressions without any upper bound or complexity limit. Expansion is performed eagerly and synchronously, meaning the full result set is generated before returning control to the caller.

For example, the following input:

{0..99}{0..99}{0..99}{0..99}{0..99}

produces:

100^5 = 10,000,000,000 combinations

This exponential growth can quickly overwhelm the event loop and heap memory, resulting in process termination.

Proof of Concept

The following script reliably triggers the issue.

Create poc.js:

const { expand } = require('@isaacs/brace-expansion');

const pattern = '{0..99}{0..99}{0..99}{0..99}{0..99}';

console.log('Starting expansion...');
expand(pattern);

Run it:

node poc.js

The process will freeze and typically crash with an error such as:

FATAL ERROR: JavaScript heap out of memory

Impact

This is a denial of service vulnerability. Any application or downstream dependency that uses @isaacs/brace-expansion on untrusted input may be vulnerable to a single-request crash.

An attacker does not require authentication and can use a very small payload to:

  • Trigger exponential computation
  • Exhaust memory and CPU resources
  • Block the event loop
  • Crash Node.js services relying on this library
Database specific
{
    "cwe_ids": [
        "CWE-1333"
    ],
    "github_reviewed_at": "2026-02-03T19:41:15Z",
    "nvd_published_at": "2026-02-04T22:16:00Z",
    "severity": "HIGH",
    "github_reviewed": true
}
References

Affected packages

npm / @isaacs/brace-expansion

Package

Name
@isaacs/brace-expansion
View open source insights on deps.dev
Purl
pkg:npm/%40isaacs/brace-expansion

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.0.1

Database specific

last_known_affected_version_range
"<= 5.0.0"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/02/GHSA-7h2j-956f-4vf2/GHSA-7h2j-956f-4vf2.json"