CVE-2017-18077: ReDoS in brace-expansion

brace-expansion Updated 02 Oct 2025

Summary

29/01/2018
Yes i
High
7.5

CVE-2017-18077: ReDoS in brace-expansion. Affects brace-expansion versions < 1.1.7. Fixed in 1.1.7. How to fix ↓

Also tracked for

The same CVE-2017-18077 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

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

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The brace-expansion package is an npm package that provides functionality for expanding and generating strings using brace expansion patterns. It allows users to generate combinations of strings based on a specified pattern. This package is vulnerable to a regular expression denial of service (ReDoS) condition.

Vulnerability Detail

The vulnerability in brace-expansion arises from a lack of input validation and sanitization. An attacker can exploit this by providing a specially crafted input that triggers a ReDoS condition. This can cause the application to consume excessive CPU resources and potentially lead to a denial of service. The vulnerability has a CVSS score of 7.5, indicating a high severity.

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 version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.1.7

This is the first release that contains the fix.

npm install brace-expansion@1.1.7

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating to the latest version is not immediately feasible, a temporary workaround is to avoid using the brace-expansion package or to implement input validation and sanitization measures to mitigate the risk of ReDoS attacks. Here is an example of input validation for brace expansion patterns:

const expand = require('brace-expansion');

function validateInput(input) {
  const MAX_PATTERN_LENGTH = 100;

  if (input.length > MAX_PATTERN_LENGTH) {
    throw new Error('Input pattern is too long.');
  }

  // Additional validation logic
}

const input = '{a,b,c}';

try {
  validateInput(input);
  expand(input);
} catch (error) {
  console.error('Error:', error.message);
}

Conclusion

The brace-expansion package is vulnerable to a ReDoS condition, which can lead to a denial of service. It is crucial to update to version 1.1.7 or later to mitigate this vulnerability. If immediate updating is not possible, implementing input validation and sanitization measures can provide temporary protection. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for brace-expansion →

Share this vulnerability

FAQ

The vulnerability can lead to a denial of service condition, causing the application to consume excessive CPU resources and potentially become unresponsive.

You can use Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities using package-lock.json.

Yes, updating to version 1.1.7 or later of the brace-expansion package fixes this vulnerability.

A temporary workaround is to avoid using the brace-expansion package or implement input validation and sanitization measures to mitigate the risk of ReDoS attacks.

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

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 version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.1.7

This is the first release that contains the fix.

npm install brace-expansion@1.1.7

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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