Vulnerability · Published Mar 25, 2024 · Assigned by GitHub_M

CVE-2024-29041Express.js Open Redirect in malformed URLs

Medium 6.1

In plain English

A medium-severity open redirect in express from expressjs. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.8% (higher than 56% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)6.1Medium
Exploit odds (30 days)0.8%top 43.7% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

Express.js minimalist web framework for node. Versions of Express.js prior to 4.19.0 and all pre-release alpha and beta versions of 5.0 are affected by an open redirect vulnerability using malformed URLs. When a user of Express performs a redirect using a user-provided URL Express performs an encode [using `encodeurl`](https://github.com/pillarjs/encodeurl) on the contents 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()`. The vulnerability is fixed in 4.19.2 and 5.0.0-beta.3.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12node-expressno fix listedDEBIAN-CVE-2024-29041
Debian:13node-express4.19.2+~cs8.36.21-1DEBIAN-CVE-2024-29041
Debian:14node-express4.19.2+~cs8.36.21-1DEBIAN-CVE-2024-29041
npmexpress4.19.2GHSA-rv95-896h-c2vc
npmexpress5.0.0-beta.3GHSA-rv95-896h-c2vc

Affected products (as reported)

VendorProductVersions
expressjs express >=4.14.0, <4.19.0>=5.0.0-alpha.1, <5.0.0-beta.3

Weakness: CWE-601, CWE-1286 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

References