CVE-2024-21538:
Regular Expression Denial of Service (ReDoS) in cross-spawn
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.38958%
CWE
Published
11/8/2024
Updated
5/19/2025
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
cross-spawn | npm | >= 7.0.0, < 7.0.5 | 7.0.5 |
cross-spawn | npm | < 6.0.6 | 6.0.6 |
Vulnerability Intelligence
Miggo AI
Root 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.