Miggo Logo

CVE-2025-5889:
brace-expansion Regular Expression Denial of Service Vulnerability

3.1

CVSS Score
3.1

Basic Information

EPSS Score
0.16132%
Published
6/9/2025
Updated
6/10/2025
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L
Package NameEcosystemVulnerable VersionsFirst Patched Version
brace-expansionnpm>= 2.0.1, <= 4.0.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability is a Regular Expression Denial of Service (ReDoS) in the brace-expansion npm package. The provided information explicitly states that the expand function in index.js is affected. I attempted to fetch structured commit information using get_commit_infos and get_commit_urls_from_pull_request, but these attempts failed. However, I was able to fetch the content of the commit page using fetch_url_content. This content included the diff for index.js, showing a change in a regular expression within the expand function. The original regex /,.*}/ was replaced by /,(?!,).*}/. This type of change is characteristic of a ReDoS fix, where an inefficient regex is replaced with a more performant one. The vulnerability description confirms that the issue is related to inefficient regular expression complexity. Therefore, the expand function is identified as the vulnerable function because it contained the problematic regex prior to the patch.

Vulnerable functions

expand
index.js
The function 'expand' in 'index.js' used an inefficient regular expression `/,.*}/` which could lead to a Regular Expression Denial of Service (ReDoS) when processing specially crafted input. An attacker could provide input that causes the regex engine to consume excessive resources, leading to a denial of service. The patch replaces this regex with a more efficient one `/,(?!,).*}/` to mitigate the vulnerability.

WAF Protection Rules

WAF Rule

* vuln*r**ility w*s *oun* in juli*n*ru**r *r***-*xp*nsion up to *.*.**. It **s ***n r*t** *s pro*l*m*ti*. *****t** *y t*is issu* is t** *un*tion *xp*n* o* t** *il* in**x.js. T** m*nipul*tion l***s to in***i*i*nt r**ul*r *xpr*ssion *ompl*xity. T** *tt

Reasoning

T** vuln*r**ility is * R**ul*r *xpr*ssion **ni*l o* S*rvi** (R**oS) in t** `*r***-*xp*nsion` npm p**k***. T** provi*** in*orm*tion *xpli*itly st*t*s t**t t** `*xp*n*` *un*tion in `in**x.js` is *****t**. I *tt*mpt** to **t** stru*tur** *ommit in*orm*t