CVE-2024-43796: express vulnerable to XSS via response.redirect()
5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.18184%
CWE
Published
9/10/2024
Updated
11/18/2024
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| express | npm | < 4.20.0 | 4.20.0 |
| express | npm | >= 5.0.0-alpha.1, < 5.0.0 | 5.0.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability lies in how the res.redirect function in lib/response.js constructs the HTML body for redirection. The commit 54271f69b511fea198471e6ff3400ab805d6b553 directly modifies this function. The patch_evidence clearly shows the removal of the vulnerable anchor tag (<a href="' + u + '">' + u + '</a>) which was the source of the XSS. The variable u represents the user-provided URL. The test file test/res.redirect.js also adds a specific test case for XSS in res.redirect, further confirming that this function was the site of the vulnerability. The description states "passing untrusted user input - even after sanitizing it - to response.redirect() may execute untrusted code", directly implicating response.redirect().