Ananto30 / golpo-express

Backend of the Social Network - Golpo
https://golpo.vercel.app
4 stars 15 forks source link

🚨 [security] Update express 4.19.2 → 4.20.0 (minor) #106

Closed depfu[bot] closed 4 days ago

depfu[bot] commented 2 weeks ago

🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ express (4.19.2 → 4.20.0) · Repo · Changelog

Security Advisories 🚨

🚨 express vulnerable to XSS via response.redirect()

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
Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ body-parser (indirect, 1.20.2 → 1.20.3) · Repo · Changelog

Security Advisories 🚨

🚨 body-parser vulnerable to denial of service when url encoding is enabled

Impact

body-parser <1.20.3 is vulnerable to denial of service when url encoding is enabled. A malicious actor using a specially crafted payload could flood the server with a large number of requests, resulting in denial of service.

Patches

this issue is patched in 1.20.3

References

Commits

See the full diff on Github. The new version differs by 8 commits:

↗️ call-bind (indirect, 1.0.2 → 1.0.7) · Repo · Changelog

Release Notes

1.0.7 (from changelog)

Commits

  • [Refactor] use es-define-property 09b76a0
  • [Deps] update get-intrinsic, set-function-length ad5136d

1.0.6 (from changelog)

Commits

  • [Dev Deps] update aud, npmignore, tape d564d5c
  • [Deps] update get-intrinsic, set-function-length cfc2bdc
  • [Refactor] use es-errors, so things that only need those do not need get-intrinsic 64cd289
  • [meta] add missing engines.node 32a4038

1.0.5 (from changelog)

Commits

  • [Fix] throw an error on non-functions as early as possible f262408
  • [Deps] update set-function-length 3fff271

1.0.3 (from changelog)

Commits

  • [actions] reuse common workflows a994df6
  • [meta] use npmignore to autogenerate an npmignore file eef3ef2
  • [readme] flesh out content 1845ccf
  • [actions] use node/install instead of node/run; use codecov action 5b47d53
  • [Refactor] use set-function-length a0e165c
  • [Dev Deps] update @ljharb/eslint-config, aud, tape 9c50103
  • [meta] simplify "exports" 019c6d0
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, safe-publish-latest, tape 23bd718
  • [actions] update codecov uploader 62552d7
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, tape ec81665
  • [Dev Deps] update eslint, @ljharb/eslint-config, safe-publish-latest, tape 35d67fc
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, tape 0266d8d
  • [Dev Deps] update @ljharb/eslint-config, aud, tape 43a5b28
  • [Deps] update define-data-property, function-bind, get-intrinsic 780eb36
  • [Dev Deps] update aud, tape 90d50ad
  • [meta] use prepublishOnly script for npm 7+ 44c5433
  • [Deps] update get-intrinsic 86bfbfc
  • [Deps] update get-intrinsic 5c53354
  • [actions] update checkout action 4c393a8
  • [Deps] update get-intrinsic 4e70bde
  • [Deps] update get-intrinsic 55ae803

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 34 commits:

↗️ get-intrinsic (indirect, 1.1.3 → 1.2.4) · Repo · Changelog

Release Notes

1.2.4 (from changelog)

Commits

  • [Refactor] use all 7 <+ ES6 Errors from es-errors bcac811

1.2.3 (from changelog)

Commits

  • [Refactor] use es-errors, so things that only need those do not need get-intrinsic f11db9c
  • [Dev Deps] update aud, es-abstract, mock-property, npmignore b7ac7d1
  • [meta] simplify exports faa0cc6
  • [meta] add missing engines.node 774dd0b
  • [Dev Deps] update tape 5828e8e
  • [Robustness] use null objects for lookups eb9a11f
  • [meta] add sideEffects flag 89bcc7a

1.2.2 (from changelog)

Commits

  • [Dev Deps] update @ljharb/eslint-config, aud, call-bind, es-abstract, mock-property, object-inspect, tape f51bcf2
  • [Refactor] use hasown instead of has 18d14b7
  • [Deps] update function-bind 6e109c8

1.2.1 (from changelog)

Commits

  • [Fix] avoid a crash in envs without __proto__ 7bad8d0
  • [Dev Deps] update es-abstract c60e6b7

1.2.0 (from changelog)

Commits

  • [actions] update checkout action ca6b12f
  • [Dev Deps] update @ljharb/eslint-config, es-abstract, object-inspect, tape 41a3727
  • [Fix] ensure Error.prototype is undeniable c511e97
  • [Dev Deps] update aud, es-abstract, tape 1bef8a8
  • [Dev Deps] update aud, es-abstract 0d41f16
  • [New] add BigInt64Array and BigUint64Array a6cca25
  • [Tests] use gopd ecf7722

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 25 commits:

↗️ merge-descriptors (indirect, 1.0.1 → 1.0.3) · Repo · Changelog

Commits

See the full diff on Github. The new version differs by 34 commits:

↗️ object-inspect (indirect, 1.12.2 → 1.13.2) · Repo · Changelog

Release Notes

1.13.2 (from changelog)

Commits

  • [readme] update badges 8a51e6b
  • [Dev Deps] update @ljharb/eslint-config, tape ef05f58
  • [Dev Deps] update error-cause, has-tostringtag, tape c0c6c26
  • [Fix] Don't throw when global is not defined d4d0965
  • [meta] add missing engines.node 17a352a
  • [Dev Deps] update globalthis 9c08884
  • [Dev Deps] update error-cause 6af352d
  • [Dev Deps] update npmignore 94e617d
  • [Dev Deps] update mock-property 2ac24d7
  • [Dev Deps] update tape 46125e5

1.13.1 (from changelog)

Commits

  • [Fix] in IE 8, global can !== window despite them being prototypes of each other 30d0859

1.13.0 (from changelog)

Commits

  • [New] add special handling for the global object 431bab2
  • [Dev Deps] update @ljharb/eslint-config, aud, tape fd4f619
  • [Dev Deps] update mock-property, tape b453f6c
  • [Dev Deps] update error-cause e8ffc57
  • [Dev Deps] update tape 054b8b9
  • [Dev Deps] temporarily remove aud due to breaking change in transitive deps 2476845
  • [Dev Deps] pin glob, since v10.3.8+ requires a broken jackspeak 383fa5e
  • [Dev Deps] pin jackspeak since 2.1.2+ depends on npm aliases, which kill the install process in npm < 6 68c244c

1.12.3 (from changelog)

Commits

  • [Fix] in eg FF 24, collections lack forEach 75fc226
  • [actions] update rebase action to use reusable workflow 250a277
  • [Dev Deps] update aud, es-value-fixtures, tape 66a19b3
  • [Dev Deps] update @ljharb/eslint-config, aud, error-cause c43d332
  • [Tests] add @pkgjs/support to postlint e2618d2

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 28 commits:

↗️ path-to-regexp (indirect, 0.1.7 → 0.1.10) · Repo · Changelog

Security Advisories 🚨

🚨 path-to-regexp outputs backtracking regular expressions

Impact

A bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (.). For example, /:a-:b.

Patches

For users of 0.1, upgrade to 0.1.10. All other users should upgrade to 8.0.0.

Version 0.1.10 adds backtracking protection when a custom regular expression is not provided, so it's still possible to manually create a ReDoS vulnerability if you are providing custom regular expressions.

Version 7.0.0 can enable strict: true and get an error when the regular expression might be bad.

Version 8.0.0 removes all features that can cause a ReDoS and stops exposing the regular expression directly.

Workarounds

All versions can be patched by providing a custom regular expression for parameters after the first in a single segment. As long as the custom regular expression does not match the text before the parameter, you will be safe. For example, change /:a-:b to /:a-:b([^-/]+).

If paths cannot be rewritten and versions cannot be upgraded, another alternative is to limit the URL length. For example, halving the attack string improves performance by 4x faster.

Details

Using /:a-:b will produce the regular expression /^\/([^\/]+?)-([^\/]+?)\/?$/. This can be exploited by a path such as /a${'-a'.repeat(8_000)}/a. OWASP has a good example of why this occurs, but the TL;DR is the /a at the end ensures this route would never match but due to naive backtracking it will still attempt every combination of the :a-:b on the repeated 8,000 -a.

Because JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and can lead to a DoS. In local benchmarks, exploiting the unsafe regex will result in performance that is over 1000x worse than the safe regex. In a more realistic environment using Express v4 and 10 concurrent connections, this translated to average latency of ~600ms vs 1ms.

References

Release Notes

0.1.10

Fixed

  • Add backtrack protection to parameters 29b96b4
    • This will break some edge cases but should improve performance

v0.1.9...v0.1.10

0.1.9

Added

component/path-to-regexp@v0.1.8...v0.1.9

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 7 commits:

↗️ send (indirect, 0.18.0 → 0.19.0) · Repo · Changelog

Security Advisories 🚨

🚨 send vulnerable to template injection that can lead to XSS

Impact

passing untrusted user input - even after sanitizing it - to SendStream.redirect() may execute untrusted code

Patches

this issue is patched in send 0.19.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
Commits

See the full diff on Github. The new version differs by 2 commits:

↗️ serve-static (indirect, 1.15.0 → 1.16.0) · Repo · Changelog

Security Advisories 🚨

🚨 serve-static vulnerable to template injection that can lead to XSS

Impact

passing untrusted user input - even after sanitizing it - to redirect() may execute untrusted code

Patches

this issue is patched in serve-static 1.16.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
Commits

See the full diff on Github. The new version differs by 2 commits:

↗️ side-channel (indirect, 1.0.4 → 1.0.6) · Repo · Changelog

Commits

See the full diff on Github. The new version differs by 22 commits:

🆕 define-data-property (added, 1.1.4)

🆕 es-define-property (added, 1.0.0)

🆕 es-errors (added, 1.3.0)

🆕 gopd (added, 1.0.1)

🆕 has-property-descriptors (added, 1.0.2)

🆕 has-proto (added, 1.0.3)

🆕 set-function-length (added, 1.2.2)

🗑️ has (removed)


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)
vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
golpo-express ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 10, 2024 8:12pm