5.0medium
serve-static affected by template injection that can lead to XSS
- Severity
- 5.0medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.87% (higher than 56% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-cm22-4g7w-348p
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
| Product or package | Versions | Reported by |
|---|---|---|
| expressjs serve-static | < 1.16.0, >= 2.0.0, < 2.1.0 | CVE List |
| serve-static (npm) | before 1.16.0, from 2.0.0 before 2.1.0 | GitHub Advisory Database |
| openjsf serve-static | before 1.16.0, from 2.0.0 before 2.1.0 | NVD |
All scores
| GitHub_M | 5.0medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L |
| GitHub | 5.0low CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L |
| GitHub | low CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:L |
| NVD | 4.7medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
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.
GitHub Advisory Database
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
NVD (es)
serve-static sirve archivos estáticos. serve-static pasa información de usuario no confiable (incluso después de sanearla) a redirect() y puede ejecutar código no confiable. Este problema se solucionó en serve-static 1.16.0.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-43800 changed 2024-09-10 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-cm22-4g7w-348p changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2024-43800 changed 2026-06-17 | Public domain |