Miggo Logo

CVE-2024-21538:
Regular Expression Denial of Service (ReDoS) in cross-spawn

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.38958%
Published
11/8/2024
Updated
5/19/2025
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
cross-spawnnpm>= 7.0.0, < 7.0.57.0.5
cross-spawnnpm< 6.0.66.0.6

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability lies in the escapeArgument function within lib/util/escape.js. The provided commit patches clearly show modifications to the regular expressions within this function to mitigate a ReDoS (Regular Expression Denial of Service) vulnerability. The commit messages explicitly mention fixing ReDoS and disabling regex backtracking. The changes involve replacing vulnerable regex patterns with more efficient and secure alternatives. Therefore, escapeArgument is the function that processes potentially malicious input and contained the vulnerability.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

V*rsions o* t** p**k*** *ross-sp*wn ***or* *.*.* *r* vuln*r**l* to R**ul*r *xpr*ssion **ni*l o* S*rvi** (R**oS) *u* to improp*r input s*nitiz*tion. *n *tt**k*r **n in*r**s* t** *PU us*** *n* *r*s* t** pro*r*m *y *r**tin* * v*ry l*r** *n* w*ll *r**t**

Reasoning

T** vuln*r**ility li*s in t** `*s**p**r*um*nt` *un*tion wit*in `li*/util/*s**p*.js`. T** provi*** *ommit p*t***s *l**rly s*ow mo*i*i**tions to t** r**ul*r *xpr*ssions wit*in t*is *un*tion to miti**t* * R**oS (R**ul*r *xpr*ssion **ni*l o* S*rvi**) vul