CVE-2025-5889: Brace expansion Denial of Service Vulnerability

LOW
Advisory Identifier: GHSA-v6h2-p8h4-qcjw
CVSS 3.1
CWE-400
Published
Advisory Summary

CVE-2025-5889 is a LOW (CVSS 3.1) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Brace expansion libraries in the npm ecosystem. The issue involves brace-expansion regular expression denial of service vulnerability. Remediation is available by upgrading affected packages to version 2.0.2, 1.1.12, 3.0.1, 4.0.1.

CVE-2025-5889 at a Glance

CVE Identifier CVE-2025-5889
GHSA Identifier GHSA-v6h2-p8h4-qcjw
Severity LOW
CVSS v3.1 Base Score 3.1
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Brace expansion
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 3.1

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

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

How to Fix CVE-2025-5889

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: 2.0.2
npm install brace-expansion@2.0.2
brace-expansion fixed: 1.1.12
npm install brace-expansion@1.1.12
brace-expansion fixed: 3.0.1
npm install brace-expansion@3.0.1
brace-expansion fixed: 4.0.1
npm install brace-expansion@4.0.1
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-2025-5889, 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 2.0.2), 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

A vulnerability was found in juliangruber brace-expansion up to 1.1.11/2.0.1/3.0.0/4.0.0. It has been rated as problematic. Affected by this issue is the function expand of the file index.js. The manipulation leads to inefficient regular expression complexity. The attack may be launched remotely. The complexity of an attack is rather high. The exploitation is known to be difficult. The exploit has been disclosed to the public and may be used. Upgrading to version 1.1.12, 2.0.2, 3.0.1 and 4.0.1 is able to address this issue. The name of the patch is `a5b98a4f30d7813266b221435e1eaaf25a1b0ac5`. It is recommended to upgrade the affected component.

CVE-2025-5889 Affected Brace expansion Versions

4 component(s)
Fixed Versions:
2.0.21.1.123.0.14.0.1
Product / Package Ecosystem Affected Versions Fixed Version
brace-expansion
npm
≥ 2.0.0
< 2.0.2
2.0.2
brace-expansion
npm
≥ 1.0.0
< 1.1.12
1.1.12
brace-expansion
npm
≥ 3.0.0
< 3.0.1
All 1 versions
3.0.0
3.0.1
brace-expansion
npm
≥ 4.0.0
< 4.0.1
All 1 versions
4.0.0
4.0.1

References

Frequently Asked Questions

What is CVE-2025-5889?
CVE-2025-5889 is a security vulnerability in Brace expansion involving brace-expansion Regular Expression Denial of Service vulnerability under CWE-400: Uncontrolled Resource Consumption.
Which Brace expansion versions are affected?
Affected versions include releases prior to 2.0.2, 1.1.12, 3.0.1, 4.0.1 across affected packages: brace-expansion.
What version fixes CVE-2025-5889?
Upgrading to 2.0.2, 1.1.12, 3.0.1, 4.0.1 (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 2.0.2, 1.1.12, 3.0.1, 4.0.1. Upgrade your dependency to 2.0.2, 1.1.12, 3.0.1, 4.0.1 or later.
What is the CVSS score of CVE-2025-5889?
CVE-2025-5889 has a CVSS v3.1 base score of 3.1 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2025-5889?
CVE-2025-5889 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-2025-5889?
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-v6h2-p8h4-qcjw",
  "modified" : "2025-06-11T20:54:10Z",
  "published" : "2025-06-09T21:30:51Z",
  "aliases" : [ "CVE-2025-5889" ],
  "summary" : "brace-expansion Regular Expression Denial of Service vulnerability",
  "details" : "A vulnerability was found in juliangruber brace-expansion up to 1.1.11/2.0.1/3.0.0/4.0.0. It has been rated as problematic. Affected by this issue is the function expand of the file index.js. The manipulation leads to inefficient regular expression complexity. The attack may be launched remotely. The complexity of an attack is rather high. The exploitation is known to be difficult. The exploit has been disclosed to the public and may be used. Upgrading to version 1.1.12, 2.0.2, 3.0.1 and 4.0.1 is able to address this issue. The name of the patch is `a5b98a4f30d7813266b221435e1eaaf25a1b0ac5`. It is recommended to upgrade the affected component.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "brace-expansion"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.0.1"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "brace-expansion"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "1.1.12"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.1.11"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "brace-expansion"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.0.1"
      } ]
    } ],
    "versions" : [ "3.0.0" ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "brace-expansion"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.0.1"
      } ]
    } ],
    "versions" : [ "4.0.0" ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-5889"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juliangruber/brace-expansion/pull/65/commits/a5b98a4f30d7813266b221435e1eaaf25a1b0ac5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juliangruber/brace-expansion/commit/0b6a9781e18e9d2769bb2931f4856d1360243ed2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juliangruber/brace-expansion/commit/15f9b3c75ebf5988198241fecaebdc45eff28a9f"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juliangruber/brace-expansion/commit/36603d5f3599a37af9e85eda30acd7d28599c36e"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juliangruber/brace-expansion/commit/c3c73c8b088defc70851843be88ccc3af08e7217"
  }, {
    "type" : "WEB",
    "url" : "https://gist.github.com/mmmsssttt404/37a40ce7d6e5ca604858fe30814d9466"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/juliangruber/brace-expansion"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?ctiid.311660"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?id.311660"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?submit.585717"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-06-10T22:51:59Z",
    "nvd_published_at" : "2025-06-09T19:15:25Z"
  }
}