Update dependency express to v5
Notable changes
- Fixed HTTP header conflict between Content-Length and Transfer-Encoding in res.send - by @YuryShkoda in #4893
- Allow conditional revalidation for QUERY requests.
req.freshpreviously only validated freshness for GET and HEAD requests, so QUERY responses never returned 304 despite a matching validator. Since QUERY is a safe, idempotent, and cacheable method that supports conditional requests, it is now included in the freshness check - by @Cherry in #7366 - Improve HTML structure in
res.redirect()responses when HTML format is accepted by adding<!DOCTYPE html>,<title>, and<body>tags for better browser compatibility - by @Bernice55231 in #5167 - When calling
app.renderwith options set to null, the locals object is handled correctly, preventing unexpected errors and making the method behave the same as when options is omitted or an empty object is passed - by AkaHarshit in #6903 - Upgrade
content-typeto^2.0.0, bringing a faster parser (~1.5x quickerContent-Typeparsing/formatting inres.send()) along with a behavior change:res.send()now keeps any existing parameters when adding the charset and no longer throws on aContent-Typethat fails to parse.type-isis upgraded to^2.1.0as part of the same change - by @blakeembrey in #7234 - The default error handler now logs the full error object instead of only its stack trace, so nested details such as
Error.causeand library-specific properties (e.g. Sequelize'sparent/original) are no longer swallowed - by @Nitin-Mohapatra in #6464 - Upgrade
content-dispositionto^2.0.1, which changes theContent-Dispositionheader emitted byres.download(),res.attachment(), andres.sendFile(): file names that are valid HTTP tokens are no longer wrapped in quotes. This is equivalent per RFC 6266, but applications asserting on the exact header bytes should update their expectations - by @blakeembrey in #7233 - Upgrade
body-parserto^2.3.0, which fixes CVE-2026-12590 (GHSA-v422-hmwv-36x6): an invalidlimitoption value caused request body size enforcement to be silently disabled (fail-open), allowing a denial of service via arbitrarily large payloads. Invalidlimitvalues now throw at parser initialization instead of being ignored - by @Mayvis in #7390 - Avoid duplicate Content-Type header processing in
res.send()when sending string responses without an explicit Content-Type header - by @bjohansebas in #6991 - Revert security fix for CVE-2024-51999 (GHSA-pj86-cfqh-vqx6)
- Security fix for CVE-2024-51999 (GHSA-pj86-cfqh-vqx6)
- deps:
body-parser@^2.2.1 - A deprecation warning was added when using
res.redirectwith undefined arguments, Express now emits a warning to help detect calls that pass undefined as the status or URL and make them easier to fix. - Add support for
Uint8Arrayinres.send() - Add support for ETag option in
res.sendFile() - Add support for multiple links with the same rel in
res.links() - Add funding field to package.json
- perf: use loop for acceptParams
- refactor: prefix built-in node module imports
- deps: remove
setprototypeof - deps: remove
safe-buffer - deps: remove
utils-merge - deps: remove
methods - deps: remove
depd - deps:
debug@^4.4.0 - deps:
body-parser@^2.2.0 - deps:
router@^2.2.0 - deps:
content-type@^1.0.5 - deps:
finalhandler@^2.1.0 - deps:
qs@^6.14.0 - deps:
server-static@2.2.0 - deps:
type-is@2.0.1 - Update
cookiesemver lock to address CVE-2024-47764 - remove:
- breaking:
- change:
- deps: cookie-signature@^1.2.1
- deps: debug@4.3.6
- deps: merge-descriptors@^2.0.0
- deps: serve-static@^2.1.0
- deps: qs@6.13.0
- deps: accepts@^2.0.0
- deps: mime-types@^3.0.0
- deps: type-is@^2.0.0
- deps: content-disposition@^1.0.0
- deps: finalhandler@^2.0.0
- deps: fresh@^2.0.0
- deps: body-parser@^2.0.1
- deps: send@^1.1.0
- Update path-to-regexp to 0.1.13 to fix CVE-2026-4867 by @baryman in #7135
- feat: allow conditional revalidation for QUERY requests (v4) by @Cherry in #7377
- deps: qs@~6.16.0 by @lazerg in #7440
- ci: add npm staged publication with dist-tag support by @UlisesGascon in #7465
- 4.22.3 by @UlisesGascon in #7466
- @baryman made their first contribution in #7135
- @lazerg made their first contribution in #7440
- fix: restore >20 array parsing for
req.queryrepeated keys (8d09bfe6) - deps: qs@~6.15.1
- deps: body-parser@~1.20.5
- @suuuuuuminnnnnn made their first contribution in #7021
- @SAY-5 made their first contribution in #7181
expressjs/express (express)
v5.3.0
=====
🐞 Bug fixes
-
Fixed HTTP header conflict between Content-Length and Transfer-Encoding in res.send - by @YuryShkoda in #4893
Fixed the behavior of
res.send()to prevent conflicts betweenContent-LengthandTransfer-EncodingHTTP headers in responses. TheContent-Lengthheader inres.send()is now only added when aTransfer-Encodingheader is not present, complying with the HTTP specification that states both headers should not coexist in the same response. ETag generation is unaffected by the presence of aTransfer-Encodingheader - by @cuishuang in #7459
-
Upgrade
qsto^6.16.0, which fixes CVE-2026-2391 (GHSA-w7fw-mjwx-w883), CVE-2026-82417 (GHSA-4mjr-xmp4-gh2g) and CVE-2026-82562 (GHSA-x5fp-wj9c-mxmx):arrayLimitbypasses in comma parsing and a denial of service via an attacker-controlledisBuffer- by @davetashner in #7057 and #7478, and @cyphercodes in #7305 -
Upgrade
proxy-addrto^2.0.8, which fixes CVE-2026-90711 - by @lazerg in #7474
🚀 Improvements
-
Allow conditional revalidation for QUERY requests.
req.freshpreviously only validated freshness for GET and HEAD requests, so QUERY responses never returned 304 despite a matching validator. Since QUERY is a safe, idempotent, and cacheable method that supports conditional requests, it is now included in the freshness check - by @Cherry in #7366// QUERY /reports with If-None-Match: "12345" app.query('/reports', (req, res) => { res.set('ETag', '"12345"'); res.send(results); // now responds 304 Not Modified });
-
Improve HTML structure in
res.redirect()responses when HTML format is accepted by adding<!DOCTYPE html>,<title>, and<body>tags for better browser compatibility - by @Bernice55231 in #5167 -
When calling
app.renderwith options set to null, the locals object is handled correctly, preventing unexpected errors and making the method behave the same as when options is omitted or an empty object is passed - by AkaHarshit in #6903app.render('index', null, callback); // now works as expected
-
Upgrade
content-typeto^2.0.0, bringing a faster parser (~1.5x quickerContent-Typeparsing/formatting inres.send()) along with a behavior change:res.send()now keeps any existing parameters when adding the charset and no longer throws on aContent-Typethat fails to parse.type-isis upgraded to^2.1.0as part of the same change - by @blakeembrey in #7234res.set('Content-Type', 'text/plain; foo=bar').send('hey'); // -> Content-Type: text/plain; foo=bar; charset=utf-8
-
The default error handler now logs the full error object instead of only its stack trace, so nested details such as
Error.causeand library-specific properties (e.g. Sequelize'sparent/original) are no longer swallowed - by @Nitin-Mohapatra in #6464 -
Upgrade
content-dispositionto^2.0.1, which changes theContent-Dispositionheader emitted byres.download(),res.attachment(), andres.sendFile(): file names that are valid HTTP tokens are no longer wrapped in quotes. This is equivalent per RFC 6266, but applications asserting on the exact header bytes should update their expectations - by @blakeembrey in #7233res.attachment('user.html'); // before -> Content-Disposition: attachment; filename="user.html" // after -> Content-Disposition: attachment; filename=user.html
-
Upgrade
body-parserto^2.3.0, which fixes CVE-2026-12590 (GHSA-v422-hmwv-36x6): an invalidlimitoption value caused request body size enforcement to be silently disabled (fail-open), allowing a denial of service via arbitrarily large payloads. Invalidlimitvalues now throw at parser initialization instead of being ignored - by @Mayvis in #7390
⚡ Performance
- Avoid duplicate Content-Type header processing in
res.send()when sending string responses without an explicit Content-Type header - by @bjohansebas in #6991
v5.2.1
=====
- Revert security fix for CVE-2024-51999 (GHSA-pj86-cfqh-vqx6)
- The prior release (5.2.0) included an erroneous breaking change related to the extended query parser. There is no actual security vulnerability associated with this behavior (CVE-2024-51999 has been rejected). The change has been fully reverted in this release.
v5.2.0
=====
- Security fix for CVE-2024-51999 (GHSA-pj86-cfqh-vqx6)
- deps:
body-parser@^2.2.1 - A deprecation warning was added when using
res.redirectwith undefined arguments, Express now emits a warning to help detect calls that pass undefined as the status or URL and make them easier to fix.
v5.1.0
=====
- Add support for
Uint8Arrayinres.send() - Add support for ETag option in
res.sendFile() - Add support for multiple links with the same rel in
res.links() - Add funding field to package.json
- perf: use loop for acceptParams
- refactor: prefix built-in node module imports
- deps: remove
setprototypeof - deps: remove
safe-buffer - deps: remove
utils-merge - deps: remove
methods - deps: remove
depd - deps:
debug@^4.4.0 - deps:
body-parser@^2.2.0 - deps:
router@^2.2.0 - deps:
content-type@^1.0.5 - deps:
finalhandler@^2.1.0 - deps:
qs@^6.14.0 - deps:
server-static@2.2.0 - deps:
type-is@2.0.1
v5.0.1
=====
- Update
cookiesemver lock to address CVE-2024-47764
v5.0.0
=====
- remove:
path-is-absolutedependency - usepath.isAbsoluteinstead
- breaking:
res.status()accepts only integers, and input must be greater than 99 and less than 1000- will throw a
RangeError: Invalid status code: ${code}. Status code must be greater than 99 and less than 1000.for inputs outside this range - will throw a
TypeError: Invalid status code: ${code}. Status code must be an integer.for non integer inputs
- will throw a
- deps: send@1.0.0
res.redirect('back')andres.location('back')is no longer a supported magic string, explicitly usereq.get('Referrer') || '/'.
- change:
res.clearCookiewill ignore user providedmaxAgeandexpiresoptions
- deps: cookie-signature@^1.2.1
- deps: debug@4.3.6
- deps: merge-descriptors@^2.0.0
- deps: serve-static@^2.1.0
- deps: qs@6.13.0
- deps: accepts@^2.0.0
- deps: mime-types@^3.0.0
application/javascript=>text/javascript
- deps: type-is@^2.0.0
- deps: content-disposition@^1.0.0
- deps: finalhandler@^2.0.0
- deps: fresh@^2.0.0
- deps: body-parser@^2.0.1
- deps: send@^1.1.0
v4.22.3
What's Changed
- Update path-to-regexp to 0.1.13 to fix CVE-2026-4867 by @baryman in #7135
- feat: allow conditional revalidation for QUERY requests (v4) by @Cherry in #7377
- deps: qs@~6.16.0 by @lazerg in #7440
- ci: add npm staged publication with dist-tag support by @UlisesGascon in #7465
- 4.22.3 by @UlisesGascon in #7466
New Contributors
Full Changelog: expressjs/express@v4.22.2...v4.22.3
v4.22.2
What's Changed
- fix: restore >20 array parsing for
req.queryrepeated keys (8d09bfe6)- This also unifies array-cap behavior across notations. Indexed notation (
a[0]=...) was historically capped at qs's defaultarrayLimitof 20 even in older qs versions; after this change it also allows up to 1000 items.
- This also unifies array-cap behavior across notations. Indexed notation (
- deps: qs@~6.15.1
- deps: body-parser@~1.20.5
New Contributors
- @suuuuuuminnnnnn made their first contribution in #7021
- @SAY-5 made their first contribution in #7181
Full Changelog: expressjs/express@v4.22.1...v4.22.2
List of commits
e4a7c00 (Update dependency express to v5, 2026-11-23)