CVE-2024-43800
JSON

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 packageVersionsReported by
expressjs serve-static< 1.16.0, >= 2.0.0, < 2.1.0CVE List
serve-static (npm)before 1.16.0, from 2.0.0 before 2.1.0GitHub Advisory Database
openjsf serve-staticbefore 1.16.0, from 2.0.0 before 2.1.0NVD

All scores

GitHub_M5.0medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L
GitHub5.0low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L
GitHublow CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:L
NVD4.7medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N

Classification

CWE-79

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:

  1. The attacker MUST control the input to response.redirect()
  2. express MUST NOT redirect before the template appears
  3. the browser MUST NOT complete redirection before:
  4. 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

SourceRecordLicence
CVE ListCVE-2024-43800 changed 2024-09-10CVE Terms of Use
GitHub Advisory DatabaseGHSA-cm22-4g7w-348p changed 2026-09-10CC-BY-4.0
NVDCVE-2024-43800 changed 2026-06-17Public domain