PT-2024-5218 · Unknown+4 · Express.Js+4
Fdrag0N
·
Published
2024-03-25
·
Updated
2026-04-05
·
CVE-2024-29041
CVSS v2.0
6.4
Medium
| Vector | AV:N/AC:L/Au:N/C:P/I:P/A:N |
Name of the Vulnerable Software and Affected Versions:
Express.js versions prior to 4.19.0
Express.js pre-release alpha and beta versions of 5.0 prior to 5.0.0-beta.3
Description:
The issue is related to an open redirect vulnerability using malformed URLs. When Express performs a redirect using a user-provided URL, it encodes the contents using
encodeurl before passing it to the location header. This can cause malformed URLs to be evaluated in unexpected ways by common redirect allow list implementations in Express applications, leading to an Open Redirect via bypass of a properly implemented allow list. The main method impacted is res.location() but this is also called from within res.redirect().Recommendations:
For Express.js versions prior to 4.19.0, update to version 4.19.2 or later.
For Express.js pre-release alpha and beta versions of 5.0, update to version 5.0.0-beta.3 or later.
As a temporary workaround, consider pre-parsing the URL string with either
require('node:url').parse or new URL before passing the user input string to res.location or res.redirect.Exploit
Fix
Open Redirect
Found an issue in the description? Have something to add? Feel free to write us 👾
Related Identifiers
Affected Products
Debian
Express.Js
Linuxmint
Red Os
Ubuntu