What’s Vulnerable › Vulnerabilities
CVE-2024-43800: serve-static affected by template injection that can lead to XSS
- Severity: medium (CVSS 4.7 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.6% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2024-09-10 · updated 2026-06-17
- Weakness: CWE-79
Description
serve-static serves static files. serve-static passes untrusted user input - even after sanitizing it - to redirect() may execute untrusted code. This issue is patched in serve-static 1.16.0.
Affected products
- expressjs serve-static: before 1.16.0; from 2.0.0 before 2.1.0 — fixed in 1.16.0, 2.1.0
- Npm Serve-Static: before 1.16.0; from 2.0.0 before 2.1.0 — fixed in 1.16.0, 2.1.0
How to fix
Upgrade to a fixed version: expressjs serve-static 1.16.0, 2.1.0; Npm Serve-Static 1.16.0, 2.1.0. Check the vendor advisory for mitigations.
References
- https://github.com/expressjs/serve-static/commit/0c11fad159898cdc69fd9ab63269b72468ecaf6b
- https://github.com/expressjs/serve-static/commit/ce730896fddce1588111d9ef6fdf20896de5c6fa
- https://github.com/expressjs/serve-static/security/advisories/GHSA-cm22-4g7w-348p
Get alerted when CVE-2024-43800 or the next vulnerability affects your stack