NodeJS/express/4.12.1
Fast, unopinionated, minimalist web framework
https://www.npmjs.com/package/express
MIT
3 Security Vulnerabilities
qs vulnerable to Prototype Pollution
qs before 6.10.3, as used in Express before 4.17.3 and other products, allows attackers to cause a Node process hang for an Express application because an __ proto__ key can be used. In many typical Express use cases, an unauthenticated remote attacker can place the attack payload in the query string of the URL that is used to visit the application, such as a[proto]=b&a[proto]&a[length]=100000000. The fix was backported to qs 6.9.7, 6.8.3, 6.7.3, 6.6.1, 6.5.3, 6.4.1, 6.3.3, and 6.2.4 (and therefore Express 4.17.3, which has deps: qs@6.9.7
in its release description, is not vulnerable).
express vulnerable to XSS via response.redirect()
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:
- The attacker MUST control the input to response.redirect()
- express MUST NOT redirect before the template appears
- the browser MUST NOT complete redirection before:
- the user MUST click on the link in the template
Express.js Open Redirect in malformed URLs
- 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
- https://nvd.nist.gov/vuln/detail/CVE-2024-29041
- https://github.com/advisories/GHSA-rv95-896h-c2vc
Impact
Versions of Express.js prior to 4.19.2 and pre-release alpha and beta versions before 5.0.0-beta.3 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
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()
.
Patches
https://github.com/expressjs/express/commit/0867302ddbde0e9463d0564fea5861feb708c2dd https://github.com/expressjs/express/commit/0b746953c4bd8e377123527db11f9cd866e39f94
An initial fix went out with express@4.19.0
, we then patched a feature regression in 4.19.1
and added improved handling for the bypass in 4.19.2
.
Workarounds
The fix for this involves pre-parsing the url string with either require('node:url').parse
or new URL
. These are steps you can take on your own before passing the user input string to res.location
or res.redirect
.
References
https://github.com/expressjs/express/pull/5539 https://github.com/koajs/koa/issues/1800 https://expressjs.com/en/4x/api.html#res.location
281 Other Versions
Version | License | Security | Released | |
---|---|---|---|---|
5.0.1 | MIT | 2024-10-08 - 19:42 | 23 days | |
5.0.0 | MIT | 2024-09-10 - 04:40 | about 2 months | |
5.0.0-beta.3 | MIT | 1 | 2024-03-25 - 14:42 | 7 months |
5.0.0-beta.2 | MIT | 2 | 2024-03-21 - 03:01 | 7 months |
5.0.0-beta.1 | MIT | 2 | 2022-02-15 - 01:11 | over 2 years |
5.0.0-alpha.8 | MIT | 2 | 2020-03-26 - 00:57 | over 4 years |
5.0.0-alpha.7 | MIT | 2 | 2018-10-27 - 03:12 | about 6 years |
5.0.0-alpha.6 | MIT | 2 | 2017-09-25 - 05:32 | about 7 years |
5.0.0-alpha.5 | MIT | 2 | 2017-03-06 - 13:51 | over 7 years |
5.0.0-alpha.4 | MIT | 2 | 2017-03-02 - 00:30 | over 7 years |
5.0.0-alpha.3 | MIT | 2 | 2017-01-29 - 03:28 | almost 8 years |
5.0.0-alpha.2 | MIT | 2 | 2015-07-07 - 05:46 | over 9 years |
5.0.0-alpha.1 | MIT | 2 | 2014-11-07 - 02:54 | almost 10 years |
4.21.1 | MIT | 2024-10-08 - 18:41 | 23 days | |
4.21.0 | MIT | 2024-09-11 - 22:33 | about 2 months | |
4.20.0 | MIT | 2024-09-10 - 02:07 | about 2 months | |
4.19.2 | MIT | 1 | 2024-03-25 - 14:30 | 7 months |
4.19.1 | MIT | 2 | 2024-03-20 - 22:19 | 8 months |
4.19.0 | MIT | 2 | 2024-03-20 - 15:14 | 8 months |
4.18.3 | MIT | 2 | 2024-02-29 - 11:50 | 8 months |
4.18.2 | MIT | 2 | 2022-10-08 - 20:14 | about 2 years |
4.18.1 | MIT | 2 | 2022-04-29 - 19:33 | over 2 years |
4.18.0 | MIT | 2 | 2022-04-25 - 19:13 | over 2 years |
4.17.3 | MIT | 2 | 2022-02-17 - 02:06 | over 2 years |
4.17.2 | MIT | 3 | 2021-12-17 - 03:48 | almost 3 years |
4.17.1 | MIT | 3 | 2019-05-26 - 04:25 | over 5 years |
4.17.0 | MIT | 3 | 2019-05-17 - 01:57 | over 5 years |
4.16.4 | MIT | 3 | 2018-10-11 - 03:59 | about 6 years |
4.16.3 | MIT | 3 | 2018-03-12 - 17:50 | over 6 years |
4.16.2 | MIT | 3 | 2017-10-10 - 03:13 | about 7 years |
4.16.1 | MIT | 3 | 2017-09-29 - 20:38 | about 7 years |
4.16.0 | MIT | 3 | 2017-09-28 - 18:22 | about 7 years |
4.15.5 | MIT | 3 | 2017-09-25 - 05:25 | about 7 years |
4.15.4 | MIT | 3 | 2017-08-07 - 02:12 | about 7 years |
4.15.3 | MIT | 3 | 2017-05-17 - 14:17 | over 7 years |
4.15.2 | MIT | 3 | 2017-03-06 - 13:42 | over 7 years |
4.15.1 | MIT | 3 | 2017-03-06 - 05:08 | over 7 years |
4.15.0 | MIT | 3 | 2017-03-01 - 22:28 | over 7 years |
4.14.1 | MIT | 3 | 2017-01-28 - 22:33 | almost 8 years |
4.14.0 | MIT | 3 | 2016-06-16 - 16:43 | over 8 years |
4.13.4 | MIT | 3 | 2016-01-22 - 02:15 | almost 9 years |
4.13.3 | MIT | 3 | 2015-08-03 - 05:04 | about 9 years |
4.13.2 | MIT | 3 | 2015-07-31 - 21:10 | over 9 years |
4.13.1 | MIT | 3 | 2015-07-06 - 05:42 | over 9 years |
4.13.0 | MIT | 3 | 2015-06-21 - 06:50 | over 9 years |
4.12.4 | MIT | 3 | 2015-05-18 - 04:41 | over 9 years |
4.12.3 | MIT | 3 | 2015-03-17 - 22:04 | over 9 years |
4.12.2 | MIT | 3 | 2015-03-03 - 05:46 | over 9 years |
4.12.1 | MIT | 3 | 2015-03-02 - 01:13 | over 9 years |
4.12.0 | MIT | 3 | 2015-02-23 - 06:58 | over 9 years |
4.11.2 | MIT | 3 | 2015-02-01 - 20:45 | over 9 years |
4.11.1 | MIT | 3 | 2015-01-21 - 08:34 | almost 10 years |
4.11.0 | MIT | 3 | 2015-01-14 - 04:21 | almost 10 years |
4.10.8 | MIT | 3 | 2015-01-13 - 17:48 | almost 10 years |
4.10.7 | MIT | 3 | 2015-01-05 - 00:40 | almost 10 years |
4.10.6 | MIT | 3 | 2014-12-13 - 04:17 | almost 10 years |
4.10.5 | MIT | 3 | 2014-12-11 - 05:08 | almost 10 years |
4.10.4 | MIT | 3 | 2014-11-25 - 05:19 | almost 10 years |
4.10.3 | MIT | 3 | 2014-11-24 - 03:12 | almost 10 years |
4.10.2 | MIT | 3 | 2014-11-10 - 00:10 | almost 10 years |
4.10.1 | MIT | 3 | 2014-10-29 - 05:21 | about 10 years |
4.10.0 | MIT | 3 | 2014-10-24 - 02:36 | about 10 years |
4.9.8 | MIT | 3 | 2014-10-18 - 02:05 | about 10 years |
4.9.7 | MIT | 3 | 2014-10-10 - 20:43 | about 10 years |
4.9.6 | MIT | 3 | 2014-10-09 - 02:35 | about 10 years |
4.9.5 | MIT | 3 | 2014-09-25 - 00:24 | about 10 years |
4.9.4 | MIT | 3 | 2014-09-20 - 06:07 | about 10 years |
4.9.3 | MIT | 3 | 2014-09-18 - 17:45 | about 10 years |
4.9.2 | MIT | 3 | 2014-09-18 - 03:52 | about 10 years |
4.9.1 | MIT | 3 | 2014-09-17 - 06:54 | about 10 years |
4.9.0 | MIT | 3 | 2014-09-09 - 04:33 | about 10 years |
4.8.8 | MIT | 3 | 2014-09-05 - 06:25 | about 10 years |
4.8.7 | MIT | 3 | 2014-08-30 - 05:37 | about 10 years |
4.8.6 | MIT | 3 | 2014-08-28 - 01:52 | about 10 years |
4.8.5 | MIT | 3 | 2014-08-19 - 03:05 | about 10 years |
4.8.4 | MIT | 3 | 2014-08-15 - 04:25 | about 10 years |
4.8.3 | MIT | 3 | 2014-08-11 - 02:29 | about 10 years |
4.8.2 | MIT | 3 | 2014-08-07 - 16:04 | about 10 years |
4.8.1 | MIT | 3 | 2014-08-06 - 22:20 | about 10 years |
4.8.0 | MIT | 3 | 2014-08-06 - 06:50 | about 10 years |
4.7.4 | MIT | 3 | 2014-08-04 - 22:25 | about 10 years |
4.7.3 | MIT | 3 | 2014-08-04 - 20:13 | about 10 years |
4.7.2 | MIT | 3 | 2014-07-27 - 20:02 | over 10 years |
4.7.1 | MIT | 3 | 2014-07-26 - 23:02 | over 10 years |
4.7.0 | MIT | 3 | 2014-07-26 - 01:34 | over 10 years |
4.6.1 | MIT | 3 | 2014-07-13 - 02:19 | over 10 years |
4.6.0 | MIT | 3 | 2014-07-12 - 03:40 | over 10 years |
4.5.1 | MIT | 3 | 2014-07-06 - 23:47 | over 10 years |
4.5.0 | MIT | 3 | 2014-07-05 - 01:04 | over 10 years |
4.4.5 | MIT | 4 | 2014-06-27 - 03:54 | over 10 years |
4.4.4 | MIT | 4 | 2014-06-20 - 21:13 | over 10 years |
4.4.3 | MIT | 4 | 2014-06-12 - 04:42 | over 10 years |
4.4.2 | MIT | 4 | 2014-06-10 - 00:43 | over 10 years |
4.4.1 | MIT | 4 | 2014-06-03 - 01:27 | over 10 years |
4.4.0 | MIT | 4 | 2014-05-31 - 04:02 | over 10 years |
4.3.2 | MIT | 4 | 2014-05-29 - 04:20 | over 10 years |
4.3.1 | MIT | 4 | 2014-05-23 - 23:12 | over 10 years |
4.3.0 | MIT | 4 | 2014-05-21 - 06:14 | over 10 years |
4.2.0 | MIT | 4 | 2014-05-12 - 02:04 | over 10 years |
4.1.2 | MIT | 4 | 2014-05-08 - 18:44 | over 10 years |