NodeJS/express/3.0.0
Fast, unopinionated, minimalist web framework
https://www.npmjs.com/package/express
MIT
5 Security Vulnerabilities
No Charset in Content-Type Header in express
Vulnerable versions of express do not specify a charset field in the content-type header while displaying 400 level response messages. The lack of enforcing user's browser to set correct charset, could be leveraged by an attacker to perform a cross-site scripting attack, using non-standard encodings, like UTF-7.
Recommendation
For express 3.x, update express to version 3.11 or later. For express 4.x, update express to version 4.5 or later.
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
No Charset in Content-Type Header
Vulnerable versions of express do not specify a charset field in the content-type header while displaying 400 level response messages. The lack of enforcing user's browser to set correct charset, could be leveraged by an attacker to perform a cross-site scripting attack, using non-standard encodings, like UTF-7.
281 Other Versions
Version | License | Security | Released | |
---|---|---|---|---|
3.0.2 | MIT | 5 | 2012-11-08 - 17:15 | almost 12 years |
3.0.1 | MIT | 5 | 2012-11-02 - 00:27 | almost 12 years |
3.0.0 | MIT | 5 | 2012-10-23 - 22:30 | about 12 years |
3.0.0-rc5 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
3.0.0-rc4 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
3.0.0-rc3 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
3.0.0-rc2 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
3.0.0-rc1 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
3.0.0-beta7 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
3.0.0-beta6 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
3.0.0-beta4 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
3.0.0-beta3 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
3.0.0-beta2 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
3.0.0-beta1 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
3.0.0-alpha5 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
3.0.0-alpha4 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
3.0.0-alpha3 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
3.0.0-alpha2 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
3.0.0-alpha1 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
2.5.11 | MIT | 5 | 2012-07-04 - 18:24 | over 12 years |
2.5.10 | MIT | 5 | 2012-06-15 - 22:51 | over 12 years |
2.5.9 | MIT | 5 | 2012-04-03 - 02:21 | over 12 years |
2.5.8 | MIT | 5 | 2012-02-08 - 20:08 | over 12 years |
2.5.7 | MIT | 5 | 2012-02-06 - 18:06 | over 12 years |
2.5.6 | MIT | 5 | 2012-01-13 - 23:40 | almost 13 years |
2.5.5 | MIT | 5 | 2012-01-08 - 20:31 | almost 13 years |
2.5.4 | MIT | 5 | 2012-01-02 - 16:36 | almost 13 years |
2.5.3 | MIT | 5 | 2011-12-30 - 23:31 | almost 13 years |
2.5.2 | MIT | 5 | 2011-12-10 - 19:09 | almost 13 years |
2.5.1 | MIT | 5 | 2011-11-18 - 16:04 | almost 13 years |
2.5.0 | MIT | 5 | 2011-10-24 - 23:01 | about 13 years |
2.4.7 | MIT | 5 | 2011-10-05 - 22:42 | about 13 years |
2.4.6 | MIT | 5 | 2011-08-22 - 17:20 | about 13 years |
2.4.5 | MIT | 5 | 2011-08-19 - 17:13 | about 13 years |
2.4.4 | MIT | 5 | 2011-08-05 - 11:30 | about 13 years |
2.4.3 | MIT | 5 | 2011-07-14 - 19:58 | over 13 years |
2.4.2 | MIT | 5 | 2011-07-07 - 03:15 | over 13 years |
2.4.1 | MIT | 5 | 2011-07-06 - 16:57 | over 13 years |
2.4.0 | MIT | 5 | 2011-06-28 - 16:41 | over 13 years |
2.3.12 | MIT | 5 | 2011-06-22 - 20:56 | over 13 years |
2.3.11 | MIT | 5 | 2011-06-04 - 17:51 | over 13 years |
2.3.10 | MIT | 5 | 2011-05-27 - 16:20 | over 13 years |
2.3.9 | MIT | 5 | 2011-05-25 - 17:18 | over 13 years |
2.3.8 | MIT | 5 | 2011-05-25 - 04:53 | over 13 years |
2.3.7 | MIT | 5 | 2011-05-23 - 22:54 | over 13 years |
2.3.6 | MIT | 5 | 2011-05-20 - 16:42 | over 13 years |
2.3.5 | MIT | 5 | 2011-05-20 - 02:07 | over 13 years |
2.3.4 | MIT | 5 | 2011-05-08 - 17:54 | over 13 years |
2.3.3 | MIT | 5 | 2011-05-03 - 18:31 | over 13 years |
2.3.2 | MIT | 5 | 2011-04-27 - 16:13 | over 13 years |
2.3.1 | MIT | 5 | 2011-04-26 - 22:26 | over 13 years |
2.3.0 | MIT | 5 | 2011-04-25 - 16:50 | over 13 years |
2.2.2 | MIT | 5 | 2011-04-12 - 09:44 | over 13 years |
2.2.1 | MIT | 5 | 2011-04-04 - 19:23 | over 13 years |
2.2.0 | MIT | 5 | 2011-03-30 - 18:40 | over 13 years |
2.1.1 | MIT | 5 | 2011-03-29 - 17:40 | over 13 years |
2.1.0 | MIT | 5 | 2011-03-24 - 20:47 | over 13 years |
2.0.0 | MIT | 5 | 2011-03-18 - 01:06 | over 13 years |
2.0.0-rc3 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
2.0.0-rc2 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
2.0.0-rc | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
2.0.0-beta3 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
2.0.0-beta2 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
2.0.0-beta | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
1.0.8 | MIT | 5 | 2011-03-02 - 02:58 | over 13 years |
1.0.7 | MIT | 5 | 2011-02-07 - 22:26 | over 13 years |
1.0.6 | MIT | 5 | 2011-02-07 - 21:45 | over 13 years |
1.0.5 | MIT | 5 | 2011-02-05 - 19:16 | over 13 years |
1.0.4 | MIT | 5 | 2011-02-05 - 19:13 | over 13 years |
1.0.3 | MIT | 5 | 2011-01-13 - 22:09 | almost 14 years |
1.0.2 | MIT | 5 | 2011-01-11 - 02:09 | almost 14 years |
1.0.1 | MIT | 5 | 2010-12-29 - 19:38 | almost 14 years |
1.0.0 | MIT | 5 | 2010-12-29 - 19:38 | almost 14 years |
1.0.0-rc4 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
1.0.0-rc3 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
1.0.0-rc2 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
1.0.0-rc | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
1.0.0-beta2 | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
1.0.0-beta | MIT | 5 | 2013-08-28 - 17:04 | about 11 years |
0.14.1 | MIT | 5 | 2010-12-29 - 19:38 | almost 14 years |
0.14.0 | MIT | 5 | 2010-12-29 - 19:38 | almost 14 years |