CVE-2024-43796
JSON

5.0medium

express vulnerable to XSS via response.redirect()

Severity
5.0medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.63% (higher than 45% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-qw6h-vgh9-j6wx

Description

Express.js minimalist web framework for node. In express < 4.20.0, passing untrusted user input - even after sanitizing it - to response.redirect() may execute untrusted code. This issue is patched in express 4.20.0.

Affected

Product or packageVersionsReported by
expressjs express< 4.20.0, >= 5.0.0-alpha.1, < 5.0.0CVE List
express (npm)before 4.20.0, from 5.0.0-alpha.1 before 5.0.0GitHub Advisory Database
openjsf expressbefore 4.20.0, 5.0.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

Express.js minimalist web framework for node. In express < 4.20.0, passing untrusted user input - even after sanitizing it - to response.redirect() may execute untrusted code. This issue is patched in express 4.20.0.

GitHub Advisory Database
Impact

In express <4.20.0, passing untrusted user input - even after sanitizing it - to response.redirect() may execute untrusted code

Patches

this issue is patched in express 4.20.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)

Express.js, el framework web minimalista para Node. En Express anterior a la versión 4.20.0, pasar una entrada de usuario no confiable (incluso después de desinfectarla) a response.redirect() puede ejecutar código no confiable. Este problema se solucionó en Express 4.20.0.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-43796 changed 2024-09-10CVE Terms of Use
GitHub Advisory DatabaseGHSA-qw6h-vgh9-j6wx changed 2026-09-10CC-BY-4.0
NVDCVE-2024-43796 changed 2026-06-17Public domain