chore(deps): update dependency express to ^4.20.0 [security] - autoclosed #11
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
->^4.20.0
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 specifiedv4.9.7
Compare Source
==================
v4.9.6
Compare Source
==================
v4.9.5
Compare Source
==================
forwarded
npm modulev4.9.4
Compare Source
==================
v4.9.3
Compare Source
==================
v4.9.2
Compare Source
==================
path
inapp.use
router.use
to accept array of middleware without pathapp.use
argumentsv4.9.1
Compare Source
==================
app.use
to accept array of middleware without pathv4.9.0
Compare Source
==================
res.sendStatus
res.sendFile
,res.sendfile
, andres.download
err
will be populated with request aborted errorreq.subdomains
etag
to generateETag
headersmime-types
X-Content-Type-Options: nosniff
headerlastModified
optionetag
to generateETag
headerlastModified
optionhasbody
to be true forcontent-length: 0
Vary
header string asfield
v4.8.8
Compare Source
==================
root
v4.8.7
Compare Source
==================
v4.8.6
Compare Source
==================
v4.8.5
Compare Source
==================
v4.8.4
Compare Source
==================
fd
leak in Node.js 0.10 forfs.ReadStream
v4.8.3
Compare Source
==================
req.originalUrl
valuesv4.8.2
Compare Source
==================
v4.8.1
Compare Source
==================
res.download
v4.8.0
Compare Source
==================
res.sendFile
root
option specifiedres.sendfile
-- useres.sendFile
insteadapp.use()
extensions
optionextensions
optionv4.7.4
Compare Source
==================
res.sendfile
regression for serving directory index filesv4.7.3
Compare Source
==================
v4.7.2
Compare Source
==================
v4.7.1
Compare Source
==================
Error.stackTraceLimit
is too lowv4.7.0
Compare Source
==================
req.protocol
for proxy-direct connectionsapp.set('query parser', parser)
app.set('query parser', 'extended')
parse with "qs" moduleapp.set('query parser', 'simple')
parse with "querystring" core moduleapp.set('query parser', false)
disable query string parsingapp.set('query parser', true)
enable simple parsingres.json(status, obj)
-- useres.status(status).json(obj)
insteadres.jsonp(status, obj)
-- useres.status(status).jsonp(obj)
insteadres.send(status, body)
-- useres.status(status).send(body)
insteadTRACE_DEPRECATION
environment variable--no-deprecation
argument--trace-deprecation
argumentRegExp
dotfiles
optionmaxAge
value to 1 yearBuffer
creation inres.send
v4.6.1
Compare Source
==================
subapp.mountpath
regression forapp.use(subapp)
v4.6.0
Compare Source
==================
app.use()
req.param(name, fn)
handlersres.redirect(url, status)
-- useres.redirect(status, url)
insteadres.send(status, num)
to sendnum
as json (not error)res.jsonp
returns JSON responsepath
inapp.use(path, fn)
RegExp
try
blocksapp.use(fn)
CONNECT
res
methodsv4.5.1
Compare Source
==================
req.method
v4.5.0
Compare Source
==================
req.accepts*
res.send(body, status)
res.vary()
headers
option tores.sendfile
mergeParams
option toRouter
req.params
from parent routesreq.hostname
-- correct name for whatreq.host
returnsdepd
modulereq.host
-- usereq.hostname
insteadroute.all
is only routerouter.param()
only when route matchesreq.params
after invoking routerfinalhandler
for final response handlingmedia-typer
to alter content-type charsetmaxage
(converted byms
)maxAge
(converted byms
)setHeaders
optionv4.4.5
Compare Source
==================
v4.4.4
Compare Source
==================
res.attachment
Unicode filenames in Safariexpress:router
v4.4.3
[Compare Source](https://redirect.github.com/expressjs/express/compare/4.4.2...4.4
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, 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.