{"id":"CVE-2024-29041","state":"PUBLISHED","title":"Express.js Open Redirect in malformed URLs","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.","publishedAt":"2024-03-25T20:20:06.205Z","updatedAt":"2024-08-02T01:03:51.705Z","severity":{"score":6.1,"label":"Medium","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","source":"GitHub_M"},"assigner":"GitHub_M","products":["expressjs express"],"affected":[{"vendor":"expressjs","product":"express","versions":[{"version":">=4.14.0, <4.19.0","status":"affected"},{"version":">=5.0.0-alpha.1, <5.0.0-beta.3","status":"affected"}]}],"references":["https://github.com/expressjs/express/security/advisories/GHSA-rv95-896h-c2vc","https://github.com/koajs/koa/issues/1800","https://github.com/expressjs/express/pull/5539","https://github.com/expressjs/express/commit/0867302ddbde0e9463d0564fea5861feb708c2dd","https://github.com/expressjs/express/commit/0b746953c4bd8e377123527db11f9cd866e39f94","https://expressjs.com/en/4x/api.html#res.location"],"weaknesses":["CWE-601","CWE-1286"],"ingestedAt":"2026-10-29T20:07:21.467Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/29xxx/CVE-2024-29041.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.1","cveMetadata":{"cveId":"CVE-2024-29041","state":"PUBLISHED","datePublished":"2024-03-25T20:20:06.205Z","dateUpdated":"2024-08-02T01:03:51.705Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2024-03-14T16:59:47.614Z"},"containers":{"cna":{"title":"Express.js Open Redirect in malformed URLs","descriptions":[{"lang":"en","value":"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":[{"vendor":"expressjs","product":"express","versions":[{"version":">=4.14.0, <4.19.0","status":"affected"},{"version":">=5.0.0-alpha.1, <5.0.0-beta.3","status":"affected"}]}],"references":[{"url":"https://github.com/expressjs/express/security/advisories/GHSA-rv95-896h-c2vc","name":"https://github.com/expressjs/express/security/advisories/GHSA-rv95-896h-c2vc","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/koajs/koa/issues/1800","name":"https://github.com/koajs/koa/issues/1800","tags":["x_refsource_MISC"]},{"url":"https://github.com/expressjs/express/pull/5539","name":"https://github.com/expressjs/express/pull/5539","tags":["x_refsource_MISC"]},{"url":"https://github.com/expressjs/express/commit/0867302ddbde0e9463d0564fea5861feb708c2dd","name":"https://github.com/expressjs/express/commit/0867302ddbde0e9463d0564fea5861feb708c2dd","tags":["x_refsource_MISC"]},{"url":"https://github.com/expressjs/express/commit/0b746953c4bd8e377123527db11f9cd866e39f94","name":"https://github.com/expressjs/express/commit/0b746953c4bd8e377123527db11f9cd866e39f94","tags":["x_refsource_MISC"]},{"url":"https://expressjs.com/en/4x/api.html#res.location","name":"https://expressjs.com/en/4x/api.html#res.location","tags":["x_refsource_MISC"]}],"metrics":[{"cvssV3_1":{"attackComplexity":"LOW","attackVector":"NETWORK","availabilityImpact":"NONE","baseScore":6.1,"baseSeverity":"MEDIUM","confidentialityImpact":"LOW","integrityImpact":"LOW","privilegesRequired":"NONE","scope":"CHANGED","userInteraction":"REQUIRED","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","version":"3.1"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-601","lang":"en","description":"CWE-601: URL Redirection to Untrusted Site ('Open Redirect')","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-1286","lang":"en","description":"CWE-1286: Improper Validation of Syntactic Correctness of Input","type":"CWE"}]}],"providerMetadata":{"shortName":"GitHub_M","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateUpdated":"2024-03-25T20:20:06.205Z"},"source":{"advisory":"GHSA-rv95-896h-c2vc","discovery":"UNKNOWN"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2024-29041","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2024-03-26T13:59:28.274744Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-06-04T17:57:16.909Z"}},{"title":"CVE Program Container","references":[{"url":"https://github.com/expressjs/express/security/advisories/GHSA-rv95-896h-c2vc","name":"https://github.com/expressjs/express/security/advisories/GHSA-rv95-896h-c2vc","tags":["x_refsource_CONFIRM","x_transferred"]},{"url":"https://github.com/koajs/koa/issues/1800","name":"https://github.com/koajs/koa/issues/1800","tags":["x_refsource_MISC","x_transferred"]},{"url":"https://github.com/expressjs/express/pull/5539","name":"https://github.com/expressjs/express/pull/5539","tags":["x_refsource_MISC","x_transferred"]},{"url":"https://github.com/expressjs/express/commit/0867302ddbde0e9463d0564fea5861feb708c2dd","name":"https://github.com/expressjs/express/commit/0867302ddbde0e9463d0564fea5861feb708c2dd","tags":["x_refsource_MISC","x_transferred"]},{"url":"https://github.com/expressjs/express/commit/0b746953c4bd8e377123527db11f9cd866e39f94","name":"https://github.com/expressjs/express/commit/0b746953c4bd8e377123527db11f9cd866e39f94","tags":["x_refsource_MISC","x_transferred"]},{"url":"https://expressjs.com/en/4x/api.html#res.location","name":"https://expressjs.com/en/4x/api.html#res.location","tags":["x_refsource_MISC","x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-02T01:03:51.705Z"}}]}}}