CVE-2026-102278: brace-expansion Denial of Service via Uncontrolled Recursion

brace-expansion Updated 30 Sep 2026

Summary

29/09/2026
Yes i
High
7.5

CVE-2026-102278: brace-expansion: DoS via uncontrolled recursion on nested brace groups causing stack exhaustion. Affects brace-expansion across 4 version ranges.

< 1.1.20 >= 2.0.0, < 2.1.6 >= 3.0.0, < 3.0.8 >= 4.0.0, < 5.0.11

Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Brace-expansion is a widely used npm package that allows users to generate strings based on a specified pattern using braces. This package is commonly utilized in various applications for tasks such as globbing and pattern matching. However, it is vulnerable to a Denial of Service (DoS) attack due to uncontrolled recursion on nested brace groups, which can lead to stack exhaustion and application crashes.

Vulnerability Detail

The vulnerability arises from the expand_() function in the brace-expansion package, which recurses for each level of brace nesting. If an attacker provides deeply nested input, it can exhaust the native stack, causing the application to crash. This issue is distinct from other vulnerabilities as it specifically targets the recursion depth driven by nested braces rather than chained inputs. The vulnerability can be exploited by passing untrusted strings to the expand() function, leading to a potential Denial of Service (DoS) scenario where the application terminates unexpectedly.

How To Fix

Latest published version: 5.0.12 as of 22 Oct 2026

npm install brace-expansion@5.0.12

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 1.1.20 1.1.20
    npm install brace-expansion@1.1.20
  • >= 2.0.0, < 2.1.6 2.1.6
    npm install brace-expansion@2.1.6
  • >= 3.0.0, < 3.0.8 3.0.8
    npm install brace-expansion@3.0.8
  • >= 4.0.0, < 5.0.11 5.0.11
    npm install brace-expansion@5.0.11

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, avoid passing untrusted or deeply nested strings to the expand() function. Implement input validation to restrict the depth of brace nesting that can be processed.

Conclusion

The brace-expansion package is vulnerable to a Denial of Service attack due to uncontrolled recursion on nested brace groups. It is crucial to update to the patched versions to mitigate this risk. Additionally, implementing input validation can serve as a temporary workaround to prevent exploitation.

See every vulnerability recorded for brace-expansion →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 7.5, indicating a high severity level.

The affected versions include 1.1.18, 2.1.4, 3.0.6, and 5.0.9.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check your application using the Vulert playground without any signup at Vulert Scanner.

If exploited, the application may crash due to a RangeError caused by stack exhaustion, leading to a Denial of Service (DoS).

No, the vulnerability only poses a risk of Denial of Service; there is no risk of code execution or data exposure.

Related vulnerabilities

Recent vulnerabilities recorded for brace-expansion.

How To Fix

Latest published version: 5.0.12 as of 22 Oct 2026

npm install brace-expansion@5.0.12

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 1.1.20 1.1.20
    npm install brace-expansion@1.1.20
  • >= 2.0.0, < 2.1.6 2.1.6
    npm install brace-expansion@2.1.6
  • >= 3.0.0, < 3.0.8 3.0.8
    npm install brace-expansion@3.0.8
  • >= 4.0.0, < 5.0.11 5.0.11
    npm install brace-expansion@5.0.11

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback