serve-static vulnerable to template injection that can lead to XSS
Impact
passing untrusted user input - even after sanitizing it - to redirect() may execute untrusted code
Patches
this issue is patched in serve-static 1.16.0
Workarounds
users are encouraged to upgrade to the patched version of express, but otherwise can workaround this issue by making sure any untrusted inputs are safe, ideally by validating them against an explicit allowlist
Details
successful exploitation of this vector requires the following:
- The attacker MUST control the input to response.redirect()
- express MUST NOT redirect before the template appears
- the browser MUST NOT complete redirection before:
- the user MUST click on the link in the template
Software afectado
Haz clic en una tecnología para ver todas sus vulnerabilidades.
| Plataforma | Paquete | Versiones vulnerables | Corregida en |
|---|---|---|---|
| Paquete de npm | serve-static | < 1.16.0, >= 2.0.0, < 2.1.0 | 1.16.0, 2.1.0 |
Referencias
- https://github.com/expressjs/serve-static/security/advisories/GHSA-cm22-4g7w-348p
- https://nvd.nist.gov/vuln/detail/CVE-2024-43800
- https://github.com/expressjs/serve-static/commit/0c11fad159898cdc69fd9ab63269b72468ecaf6b
- https://github.com/expressjs/serve-static/commit/ce730896fddce1588111d9ef6fdf20896de5c6fa
- https://github.com/expressjs/serve-static
- Vector CVSS
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L- Debilidad (CWE)
CWE-79- Plataforma
- npm
- Paquete
serve-static- Publicada
- 10.09.2024
- Actualizado
- 11.10.2026 10:22
Fuentes y licencias
OSV / GitHub Advisory Database - GHSA-cm22-4g7w-348p - CC BY 4.0
Historial de vulnerabilidades: serve-static
Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.
- Entradas en total
- 2
- Primera → última
- 08.2020 09.2024
- Sin corrección
- 0
- Explotada en ataques
- 0
Distribución por gravedad
- Baja 2
Divulgaciones por año
- 2020: 1
- 2021: 0
- 2022: 0
- 2023: 0
- 2024: 1
- 2025: 0
- 2026: 0
-
serve-static vulnerable to template injection that can lead to XSS esta entrada
Identifica las vulnerabilidades de tu aplicación
Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.