Skip to content

fix(deps): update dependency express to ~4.20.0 [security]#33

Open
renovate[bot] wants to merge 1 commit intomainfrom
renovate/npm-express-vulnerability
Open

fix(deps): update dependency express to ~4.20.0 [security]#33
renovate[bot] wants to merge 1 commit intomainfrom
renovate/npm-express-vulnerability

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate bot commented Mar 30, 2024

This PR contains the following updates:

Package Change Age Confidence
express (source) ~4.18.2~4.20.0 age confidence

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 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

expressjs/express@0867302
expressjs/express@0b74695

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.

Resources

https://github.com/expressjs/express/pull/5539
https://github.com/koajs/koa/issues/1800
https://expressjs.com/en/4x/api.html#res.location

Severity
  • CVSS Score: 6.1 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

CVE-2024-43796

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:

  1. The attacker MUST control the input to response.redirect()
  2. express MUST NOT redirect before the template appears
  3. the browser MUST NOT complete redirection before:
  4. the user MUST click on the link in the template
Severity
  • CVSS Score: 2.3 / 10 (Low)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:L

Release Notes

expressjs/express (express)

v4.20.0

Compare Source

==========

  • deps: serve-static@​0.16.0
    • Remove link renderization in html while redirecting
  • deps: send@​0.19.0
    • Remove link renderization in html while redirecting
  • deps: body-parser@​0.6.0
    • add depth option to customize the depth level in the parser
    • IMPORTANT: The default depth level for parsing URL-encoded data is now 32 (previously was Infinity)
  • Remove link renderization in html while using res.redirect
  • deps: path-to-regexp@​0.1.10
    • Adds support for named matching groups in the routes using a regex
    • Adds backtracking protection to parameters without regexes defined
  • deps: encodeurl@~2.0.0
    • Removes encoding of \, |, and ^ to align better with URL spec
  • Deprecate passing options.maxAge and options.expires to res.clearCookie
    • Will be ignored in v5, clearCookie will set a cookie with an expires in the past to instruct clients to delete the cookie

v4.19.2

Compare Source

==========

  • Improved fix for open redirect allow list bypass

v4.19.1

Compare Source

==========

  • Allow passing non-strings to res.location with new encoding handling checks

v4.19.0

Compare Source

==========

  • Prevent open redirect allow list bypass due to encodeurl
  • deps: cookie@​0.6.0

v4.18.3

Compare Source

==========

  • Fix routing requests without method
  • deps: body-parser@​1.20.2
    • Fix strict json error message on Node.js 19+
    • deps: content-type@~1.0.5
    • deps: raw-body@​2.5.2
  • deps: cookie@​0.6.0
    • Add partitioned option

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • ""
  • 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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot requested a review from sullivanpj as a code owner March 30, 2024 05:54
@renovate renovate bot requested a review from sullivanpj March 30, 2024 05:54
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 30, 2024

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​escape.tech/​graphql-armor-types@​0.5.01001006284100
Added@​graphql-codegen/​add@​5.0.01001006299100
Added@​eventcatalog/​types@​0.4.2711006276100
Added@​graphql-yoga/​plugin-response-cache@​2.2.0971006699100
Added@​graphql-codegen/​typescript-resolvers@​4.0.11001006799100
Added@​graphql-tools/​graphql-file-loader@​8.0.0731006799100
Added@​graphql-codegen/​graphql-modules-preset@​4.0.1951006899100
Added@​prisma/​generator-helper@​5.4.11001007098100
Added@​graphql-codegen/​typescript@​4.0.11001007099100
Added@​opentelemetry/​sdk-trace-node@​1.17.07110010093100
Added@​prisma/​internals@​5.4.1941007298100
Added@​graphql-tools/​schema@​10.0.01001007299100
Added@​graphql-codegen/​core@​4.0.01001007399100
Added@​graphql-tools/​utils@​10.0.61001007499100
Added@​eventcatalog/​plugin-doc-generator-asyncapi@​0.3.5741007778100
Added@​graphql-tools/​load@​8.0.01001007499100
Added@​n1ru4l/​graphql-live-query-patch-jsondiffpatch@​0.8.07510010080100
Added@​heroicons/​react@​2.0.181001007785100
Added@​graphql-codegen/​cli@​4.0.1951007799100
Added@​eventcatalog/​core@​1.1.0831007796100
Added@​nxkit/​style-dictionary@​3.0.2801009777100
Added@​nx-plus/​docusaurus@​15.0.0-rc.08610010079100
Added@​n1ru4l/​json-patch-plus@​0.2.0981008480100
Added@​n1ru4l/​push-pull-async-iterable-iterator@​3.2.010010010080100
Added@​graphql-eslint/​eslint-plugin@​3.20.1981008282100
Added@​js-temporal/​polyfill@​0.4.4991009583100
Added@​prisma/​client@​5.4.1931008397100
Added@​manypkg/​cli@​0.21.0981009684100
Added@​hookform/​devtools@​4.3.1981009784100
Added@​nx/​linter@​16.9.11001009185100
Added@​opentelemetry/​semantic-conventions@​1.17.01001008590100
Added@​next/​bundle-analyzer@​13.5.41001008799100
See 21 more rows in the dashboard

View full report

@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 30, 2024

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

@renovate renovate bot force-pushed the renovate/npm-express-vulnerability branch from 73dbdc9 to 07ee2f7 Compare September 19, 2024 20:34
@renovate renovate bot changed the title fix(deps): update dependency express to ~4.19.0 [security] fix(deps): update dependency express to ~4.20.0 [security] Sep 19, 2024
@sonarqubecloud
Copy link
Copy Markdown

@renovate renovate bot force-pushed the renovate/npm-express-vulnerability branch from 07ee2f7 to 002e970 Compare April 15, 2026 16:05
@renovate renovate bot requested a review from a team April 15, 2026 16:05
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.

0 participants