Skip to main content

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

High
VulnerabilityCVE-2024-21538cvecve-2024-21538
Published: Fri Nov 08 2024 (11/08/2024, 05:00:04 UTC)
Source: CVE
Vendor/Project: n/a
Product: cross-spawn

Description

Versions of the package cross-spawn before 6.0.6, from 7.0.0 and before 7.0.5 are vulnerable to Regular Expression Denial of Service (ReDoS) due to improper input sanitization. An attacker can increase the CPU usage and crash the program by crafting a very large and well crafted string.

AI-Powered Analysis

AILast updated: 07/04/2025, 11:13:48 UTC

Technical Analysis

CVE-2024-21538 is a high-severity vulnerability affecting the cross-spawn package, specifically versions before 6.0.6 and from 7.0.0 up to but not including 7.0.5. The vulnerability is a Regular Expression Denial of Service (ReDoS) caused by improper input sanitization in the package's handling of input strings. An attacker can exploit this flaw by crafting a specially designed, very large string that triggers excessive CPU consumption during regular expression processing. This leads to resource exhaustion, causing the affected application to slow down significantly or crash entirely. The vulnerability does not require any authentication or user interaction and can be exploited remotely, as indicated by the CVSS vector (AV:N/AC:L/PR:N/UI:N). The vulnerability is classified under CWE-1333, which relates to ReDoS issues stemming from inefficient regular expression implementations. Although no known exploits are currently reported in the wild, the high CVSS score of 8.7 reflects the potential for impactful denial of service attacks. The cross-spawn package is commonly used in Node.js environments to spawn child processes, often as part of build tools, development utilities, and server-side applications. Therefore, any application or service relying on vulnerable versions of cross-spawn is at risk of being disrupted by this attack vector.

Potential Impact

For European organizations, the impact of this vulnerability can be significant, especially for those relying on Node.js-based infrastructure, development pipelines, or server-side applications that incorporate the cross-spawn package. Exploitation can lead to denial of service conditions, resulting in application downtime, degraded performance, and potential disruption of critical business operations. This is particularly concerning for sectors such as finance, healthcare, telecommunications, and government services where availability and reliability are paramount. Additionally, the increased CPU usage caused by the attack could lead to higher operational costs and potential cascading failures in systems with limited resources. Since the vulnerability does not require authentication or user interaction, it can be exploited by remote attackers scanning for vulnerable endpoints, increasing the risk of widespread disruption. The absence of known exploits in the wild currently reduces immediate risk but does not eliminate the threat, especially as attackers may develop exploits following public disclosure.

Mitigation Recommendations

European organizations should take immediate steps to mitigate this vulnerability by upgrading the cross-spawn package to versions 6.0.6 or 7.0.5 and later, where the issue has been addressed. It is critical to audit all Node.js projects and dependencies to identify and update any vulnerable versions of cross-spawn. For environments where immediate upgrading is not feasible, implementing input validation and sanitization to limit the size and complexity of strings processed by cross-spawn can reduce the risk of exploitation. Additionally, deploying runtime protections such as CPU usage monitoring and rate limiting can help detect and mitigate potential ReDoS attacks. Organizations should also consider isolating critical services and applying resource quotas to prevent a single process from exhausting system resources. Regularly monitoring security advisories and integrating automated dependency scanning tools into CI/CD pipelines will help maintain awareness and prompt remediation of similar vulnerabilities in the future.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
snyk
Date Reserved
2023-12-22T12:33:20.123Z
Cisa Enriched
true
Cvss Version
4.0
State
PUBLISHED

Threat ID: 682cd0f71484d88663aeb016

Added to database: 5/20/2025, 6:59:03 PM

Last enriched: 7/4/2025, 11:13:48 AM

Last updated: 7/25/2025, 3:53:55 PM

Views: 14

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats