Skip to content

[Snyk] Upgrade express from 5.2.1 to 5.3.0 - #144

Open
peterj wants to merge 2 commits into
mainfrom
snyk-upgrade-5bc383c074b87995822cebc126fbabd4
Open

peterj wants to merge 2 commits into
mainfrom
snyk-upgrade-5bc383c074b87995822cebc126fbabd4

Conversation

@peterj

@peterj peterj commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

snyk-top-banner

Snyk has created this PR to upgrade express from 5.2.1 to 5.3.0.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


  • The recommended version is 1 version ahead of your current version.

  • The recommended version was released a month ago.

Breaking Change Risk

Merge Risk: Medium

Notice: This assessment is enhanced by AI.

Release notes
Package name: express
  • 5.3.0 - 2026-10-09

    Highlights

    🐞 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 between Content-Length and Transfer-Encoding HTTP headers in responses. The Content-Length header in res.send() is now only added when a Transfer-Encoding header 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 a Transfer-Encoding header - by @ cuishuang in #7459

    🚀 Improvements

    • Allow conditional revalidation for QUERY requests. req.fresh previously 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.render with 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

      app.render('index', null, callback); // now works as expected
    • Upgrade content-type to ^2.0.0, bringing a faster parser (~1.5x quicker Content-Type parsing/formatting in res.send()) along with a behavior change: res.send() now keeps any existing parameters when adding the charset and no longer throws on a Content-Type that fails to parse. type-is is upgraded to ^2.1.0 as part of the same change - by @ blakeembrey in #7234

      res.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.cause and library-specific properties (e.g. Sequelize's parent/original) are no longer swallowed - by @ Nitin-Mohapatra in #6464

    • Upgrade content-disposition to ^2.0.1, which changes the Content-Disposition header emitted by res.download(), res.attachment(), and res.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

      res.attachment('user.html');
      // before -> Content-Disposition: attachment; filename="user.html"
      // after  -> Content-Disposition: attachment; filename=user.html
    • Upgrade body-parser to ^2.3.0, which fixes CVE-2026-12590 (GHSA-v422-hmwv-36x6): an invalid limit option value caused request body size enforcement to be silently disabled (fail-open), allowing a denial of service via arbitrarily large payloads. Invalid limit values 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

    What's Changed

Snyk has created this PR to upgrade express from 5.2.1 to 5.3.0.

See this package in npm:
express

See this project in Snyk:
https://app.snyk.io/org/kagent/project/8e104b77-2401-41e5-860c-f1d50686348a?utm_source=github&utm_medium=referral&page=upgrade-pr
Snyk has created this PR to upgrade express from 5.2.1 to 5.3.0.

See this package in npm:
express

See this project in Snyk:
https://app.snyk.io/org/kagent/project/8e104b77-2401-41e5-860c-f1d50686348a?utm_source=github&utm_medium=referral&page=upgrade-pr
@peterj

peterj commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Merge Risk: Medium

This minor version upgrade for Express includes bug fixes that could introduce behavioral changes in specific scenarios.

Key Changes:

  • Behavioral Change in res.send: A fix has been implemented to prevent conflicts between Content-Length and Transfer-Encoding HTTP headers sent by res.send. While this aligns the framework with standards, applications that might have relied on the previous incorrect behavior should be verified.
  • Other Fixes: The release also includes improvements to the HTML structure in responses for better browser compatibility and a fix for an edge case in app.render when options are null.

Recommendation:
While no mandatory code changes are required, it is recommended to verify application behavior, especially if you have custom logic related to HTTP header manipulation or are operating behind a proxy sensitive to Transfer-Encoding.

Source: Release Announcement

Notice 🤖: This content was augmented using artificial intelligence. AI-generated content may contain errors and should be reviewed for accuracy before use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants