Update dependency express to v4.20.0 [SECURITY] #312
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
4.9.7
->4.20.0
Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
GitHub Vulnerability Alerts
CVE-2024-29041
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 thelocation
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 withinres.redirect()
.Patches
expressjs/express@0867302
expressjs/express@0b74695
An initial fix went out with
[email protected]
, we then patched a feature regression in4.19.1
and added improved handling for the bypass in4.19.2
.Workarounds
The fix for this involves pre-parsing the url string with either
require('node:url').parse
ornew URL
. These are steps you can take on your own before passing the user input string tores.location
orres.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
CVE-2024-43796
Impact
In express <4.20.0, passing untrusted user input - even after sanitizing it - to
response.redirect()
may execute untrusted codePatches
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:
Release Notes
expressjs/express (express)
v4.20.0
Compare Source
==========
depth
option to customize the depth level in the parserdepth
level for parsing URL-encoded data is now32
(previously wasInfinity
)res.redirect
\
,|
, and^
to align better with URL specoptions.maxAge
andoptions.expires
tores.clearCookie
v4.19.2
Compare Source
==========
v4.19.1
Compare Source
==========
v4.19.0
Compare Source
v4.18.3
Compare Source
==========
v4.18.2
Compare Source
===================
v4.18.1
Compare Source
===================
v4.18.0
Compare Source
===================
res.download
options
withoutfilename
inres.download
res.status
null
/undefined
asmaxAge
inres.cookie
Object.prototype
values in settings throughapp.set
/app.get
default
with same arguments as types inres.format
res.send
http-errors
forres.format
errorstrict
priority
optionexpires
option to reject invalid dateseval
usage withFunction
constructorprocess
to check for listeners425 Unordered Collection
to standard425 Too Early
v4.17.3
Compare Source
===================
__proto__
keysv4.17.2
Compare Source
===================
undefined
inres.jsonp
undefined
when"json escape"
is enabledRegExp
sres.jsonp(obj, status)
deprecation messageres.is
JSDocmaxAge
option to reject invalid valuesreq.socket
over deprecatedreq.connection
v4.17.1
Compare Source
===================
null
/undefined
tores.status
"v4.17.0
Compare Source
===================
express.raw
to parse bodies intoBuffer
express.text
to parse bodies into stringres.sendFile
null
/undefined
tores.status
X-Forwarded-Host
pb
) supportSameSite=None
supportContent-Security-Policy
headerpath.normalize
call103 Early Hints
throw
on invalid typev4.16.4
Compare Source
===================
"Request aborted"
may be logged inres.sendfile
Router
constructorv4.16.3
Compare Source
===================
%
as last characterv4.16.2
Compare Source
===================
TypeError
inres.send
when givenBuffer
andETag
header setX-Forwarded-Proto
headerv4.16.1
Compare Source
===================
root
is incorrectly set to a filev4.16.0
Compare Source
===================
"json escape"
setting forres.json
andres.jsonp
express.json
andexpress.urlencoded
to parse bodiesoptions
argument tores.download
Buffer
encoding when not generating ETag for small responsesafe-buffer
for improved Buffer APIres.headersSent
when availableRegExp
X-Forwarded-For
X-Forwarded-For
headerimmutable
option</html>
in default error & redirectsimmutable
option.charset
set inres.jsonp
v4.15.5
Compare Source
===================
If-None-Match
token parsingIf-Match
token parsingv4.15.4
Compare Source
===================
Buffer
loadingv4.15.3
Compare Source
===================
res.set
cannot add charset toContent-Type
DEBUG_MAX_ARRAY_LENGTH
</html>
in HTML documentv4.15.2
Compare Source
===================
[
v4.15.1
Compare Source
===================
Date.parse
does not returnNaN
on invalid dateDate.parse
does not returnNaN
on invalid datev4.15.0
Compare Source
===================
next("router")
to exit from routerrouter.use
skipped requests routes did notres._headers
private fieldreq.url
is not set%o
in path debug to tell types apartObject.create
to setup request & response prototypessetprototypeof
module to replace__proto__
settingstatuses
instead ofhttp
module for status messagesDEBUG_FD
environment variable set to3
or highererr
cannot be converted to a stringContent-Security-Policy: default-src 'self'
headerno-cache
request directiveIf-None-Match
has both*
and ETagsETag
matching to match specIf-None-Match
when noETag
headerDate.parse
instead ofnew Date
no-cache
request directiveIf-None-Match
has both*
and ETagsETag
matching to match specres._headers
private fieldIf-Match
andIf-Unmodified-Since
headersres.getHeaderNames()
when availableres.headersSent
when availableno-cache
request directiveIf-None-Match
has both*
and ETagsETag
matching to match specres._headers
private fieldIf-Match
andIf-Unmodified-Since
headersres.getHeaderNames()
when availableres.headersSent
when available*
routereq.ips
performancev4.14.1
Compare Source
===================
err.headers
is not an objectv4.14.0
Compare Source
===================
acceptRanges
option tores.sendFile
/res.sendfile
cacheControl
option tores.sendFile
/res.sendfile
options
argument toreq.range
combine
optionres.location
/res.redirect
if not already encodedres.sendFile
/res.sendfile
req.get()
res.json
/res.jsonp
in most casesRange
header handling inres.sendFile
/res.sendfile
Accept
parsingAccept
parameters with quoted equalsAccept
parameters with quoted semicolonssameSite
optionMax-Age
to never be a floating point numberencode
is not a functionexpires
is not aDate
serialize
err.statusCode
iferr.status
is invaliderr.headers
objectstatuses
instead ofhttp
module for status messagesdecoder
option inparse
functioncombine
option to combine overlapping rangesacceptRanges
optioncacheControl
optionStream
classContent-Range
header in 416 responses when usingstart
/end
optionsContent-Range
header missing from default 416 responsespath
contains raw non-URL characterspath
starts with multiple forward slashesRange
headersacceptRanges
optioncacheControl
optionreq.url
contains raw non-URL charactersRange
headersfield
argumentv4.13.4
Compare Source
===================
serialize
v4.13.3
Compare Source
===================
mergeParams: true
req.params
v4.13.2
Compare Source
===================
v4.13.1
Compare Source
===================
hasOwnProperty
v4.13.0
Compare Source
===================
res.format
error when onlydefault
providednext('route')
inapp.param
would incorrectly skip valuesdecodeURIComponent
URIError
s are a 400*
before params in routesres.cookie
to callres.append
array-flatten
module for flattening arraysstatusCode
property onError
objectsunpipe
module for unpiping requestsETag
matching supportCONNECT
requestsUpgrade
requestsDate
response headerContent-Location
on 304 responsehttp-errors
for standard emitted errorsstatuses
instead ofhttp
module for status messagesfallthrough
optionnext()
instead of 400app.render
try blockView
http.STATUS_CODES
v4.12.4
Compare Source
===================
fs
isFinished(req)
when data bufferedconstructor
v4.12.3
Compare Source
===================
hasOwnProperty
is presentextensions
orindex
optionsv4.12.2
Compare Source
===================
"Request aborted"
is logged usingres.sendFile
v4.12.1
Compare Source
===================
ECONNRESET
errors fromres.sendFile
usagereq.host
when using "trust proxy" hops countreq.protocol
/req.secure
when using "trust proxy" hops countcode
on aborted connections fromres.sendFile
v4.12.0
Compare Source
===================
"trust proxy"
setting to inherit when app is mountedETag
s for all request responsesGET
andHEAD
requestscontent-type
to parseContent-Type
headersoptions
hasBody
Transfer-Encoding
check*/*
)v4.11.2
Compare Source
===================
res.redirect
double-callingres.end
forHEAD
requestsv4.11.1
Compare Source
===================
v4.11.0
Compare Source
===================
res.append(field, val)
to append headers:
inname
forapp.param(name, fn)
req.param()
-- usereq.params
,req.body
, orreq.query
insteadapp.param(fn)
OPTIONS
responses to include theHEAD
method properlyres.sendFile
not always detecting aborted connectionv4.10.8
Compare Source
===================
OPTIONS
response handlerv4.10.7
Compare Source
===================
Allow
header forOPTIONS
to not contain duplicate methodsres.sendFile
whenHEAD
or 304v4.10.6
Compare Source
===================
req.fresh
/req.stale
without response headersv4.10.5
Compare Source
===================
res.send
double-callingres.end
forHEAD
requestsv4.10.4
Compare Source
===================
res.sendfile
logging standard write errorsv4.10.3
Compare Source
===================
res.sendFile
logging standard write errorsarrayLimit
behaviorv4.10.2
Compare Source
===================
v4.10.1
Compare Source
===================
://
in the pathv4.10.0
Compare Source
===================
app.set('views', array)
res.send(status)
to mentionres.sendStatus(status)
content-disposition
module forres.attachment
/res.download
Content-Disposition
headerpath.resolve
in view lookupDEBUG_FD
env variable supporton-finished
to determine request statusv4.9.8
Compare Source
==================
res.redirect
body when redirect status specifiedConfiguration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.