sarvex / cal.com

The open-source Calendly alternative.
https://calendso.com
Other
0 stars 0 forks source link

fix(deps): update dependency next-auth to v4.24.5 [security] - autoclosed #10

Closed renovate[bot] closed 5 months ago

renovate[bot] commented 5 months ago

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
next-auth (source) 4.22.1 -> 4.24.5 age adoption passing confidence

[!WARNING] Some dependencies could not be looked up. Check the Dependency Dashboard for more information.

GitHub Vulnerability Alerts

CVE-2023-48309

Impact

next-auth applications prior to version 4.24.5 that rely on the default Middleware authorization are affected.

A bad actor could create an empty/mock user, by getting hold of a NextAuth.js-issued JWT from an interrupted OAuth sign-in flow (state, PKCE or nonce).

Manually overriding the next-auth.session-token cookie value with this non-related JWT would let the user simulate a logged in user, albeit having no user information associated with it. (The only property on this user is an opaque randomly generated string).

This vulnerability does not give access to other users' data, neither to resources that require proper authorization via scopes or other means. The created mock user has no information associated with it (ie. no name, email, access_token, etc.)

This vulnerability can be exploited by bad actors to peek at logged in user states (e.g. dashboard layout).

Note: Regardless of the vulnerability, the existence of a NextAuth.js session state can provide simple authentication, but not authorization in your applications. For role-based access control, you can check out our guide.

Patches

We patched the vulnerability in next-auth v4.24.5. To upgrade, run one of the following:

npm i next-auth@latest
yarn add next-auth@latest
pnpm add next-auth@latest

Workarounds

Upgrading to latest is the recommended way to fix this issue. However, using a custom authorization callback for Middleware, developers can manually do a basic authentication:

// middleware.ts
import { withAuth } from "next-auth/middleware"

export default withAuth(/*your middleware function*/, {
  // checking the existence of any property - besides `value` which might be a random string - on the `token` object is sufficient to prevent this vulnerability
  callbacks: { authorized: ({ token }) => !!token?.email }
})

References


Release Notes

nextauthjs/next-auth (next-auth) ### [`v4.24.5`](https://togithub.com/nextauthjs/next-auth/releases/tag/next-auth%404.24.5) [Compare Source](https://togithub.com/nextauthjs/next-auth/compare/next-auth@4.24.4...next-auth@4.24.5) #### Bugfixes - differentiate between issued JWTs ### [`v4.24.4`](https://togithub.com/nextauthjs/next-auth/releases/tag/next-auth%404.24.4) [Compare Source](https://togithub.com/nextauthjs/next-auth/compare/next-auth@4.24.3...next-auth@4.24.4) #### Bugfixes - allow Next.js 14 as peer dependency ### [`v4.24.3`](https://togithub.com/nextauthjs/next-auth/releases/tag/next-auth%404.24.3) [Compare Source](https://togithub.com/nextauthjs/next-auth/compare/next-auth@4.24.2...next-auth@4.24.3) ##### Bugfixes - css build error ### [`v4.24.2`](https://togithub.com/nextauthjs/next-auth/releases/tag/next-auth%404.24.2) [Compare Source](https://togithub.com/nextauthjs/next-auth/compare/next-auth@4.24.1...next-auth@4.24.2) ##### Bugfixes - css build error ### [`v4.24.1`](https://togithub.com/nextauthjs/next-auth/releases/tag/next-auth%404.24.1) [Compare Source](https://togithub.com/nextauthjs/next-auth/compare/next-auth@4.24.0...next-auth@4.24.1) ##### Bugfixes - css build error ### [`v4.24.0`](https://togithub.com/nextauthjs/next-auth/releases/tag/next-auth%404.24.0) [Compare Source](https://togithub.com/nextauthjs/next-auth/compare/next-auth@4.23.2...next-auth@4.24.0) ##### Features - tweak default sign-in page ([#​8888](https://togithub.com/nextauthjs/next-auth/issues/8888)) ### [`v4.23.2`](https://togithub.com/nextauthjs/next-auth/releases/tag/next-auth%404.23.2) [Compare Source](https://togithub.com/nextauthjs/next-auth/compare/next-auth@4.23.1...next-auth@4.23.2) #### Bugfixes - **next**: returns correct status for signing in with `redirect: false` for route handler ([#​8775](https://togithub.com/nextauthjs/next-auth/issues/8775)) ([`27b2519`](https://togithub.com/nextauthjs/next-auth/commit/27b2519b)) - **ts**: fix typo ([`d813c00`](https://togithub.com/nextauthjs/next-auth/commit/d813c00b)) - remove trailing `?` from signIn URL ([#​8466](https://togithub.com/nextauthjs/next-auth/issues/8466)) #### Other - update security policy link ### [`v4.23.1`](https://togithub.com/nextauthjs/next-auth/releases/tag/next-auth%404.23.1) [Compare Source](https://togithub.com/nextauthjs/next-auth/compare/next-auth@4.23.0...next-auth@4.23.1) #### Bugfixes - **ts**: correctly expose `next-auth/adapters` ([`20c3fe3`](https://togithub.com/nextauthjs/next-auth/commit/20c3fe33)) - use `default` submodules export in `package.json` ([#​8330](https://togithub.com/nextauthjs/next-auth/issues/8330)) ### [`v4.23.0`](https://togithub.com/nextauthjs/next-auth/releases/tag/next-auth%404.23.0) [Compare Source](https://togithub.com/nextauthjs/next-auth/compare/next-auth@4.22.5...next-auth@4.23.0) #### Features - **providers**: add Passage by 1Password ([`5a8aa2e`](https://togithub.com/nextauthjs/next-auth/commit/5a8aa2e5)) #### Bugfixes - **ts**: correctly export submodule types ([`05ff6ae`](https://togithub.com/nextauthjs/next-auth/commit/05ff6ae2)) - sort cookie chunks correctly ([#​8284](https://togithub.com/nextauthjs/next-auth/issues/8284)) ### [`v4.22.5`](https://togithub.com/nextauthjs/next-auth/releases/tag/next-auth%404.22.5) [Compare Source](https://togithub.com/nextauthjs/next-auth/compare/next-auth@4.22.4...next-auth@4.22.5) #### Bugfixes - **ts**: match `next-auth/adapter` & `@auth/core/adapters` (https://github.com/nextauthjs/next-auth/commit/3b0128c3cabfaa014531e38e06919ea435df35fd) #### Other - docs: amplify note ### [`v4.22.4`](https://togithub.com/nextauthjs/next-auth/releases/tag/next-auth%404.22.4) [Compare Source](https://togithub.com/nextauthjs/next-auth/compare/next-auth@4.22.3...next-auth@4.22.4) #### Bugfixes - **ts**: SignInResponse.error type ([#​8109](https://togithub.com/nextauthjs/next-auth/issues/8109)) ([`465644f`](https://togithub.com/nextauthjs/next-auth/commit/465644f9)) - Remove RSC warning in `getServerSession` ([#​8108](https://togithub.com/nextauthjs/next-auth/issues/8108)) - Don't return `res.end()` in api handler ([#​8244](https://togithub.com/nextauthjs/next-auth/issues/8244)) #### Other - docs: fixing broken link in documentation ([#​8208](https://togithub.com/nextauthjs/next-auth/issues/8208)) - docs: clarify `getServerSession` - docs: move `unstable_getServerSession` - docs: Typo fixed ([#​8206](https://togithub.com/nextauthjs/next-auth/issues/8206)) - docs(providers): mention HTTP-based Email guide ([#​8214](https://togithub.com/nextauthjs/next-auth/issues/8214)) - docs: Update object key "email" to "username" ([#​8113](https://togithub.com/nextauthjs/next-auth/issues/8113)) - doc: Add a guide on sending magic links to existing users only ([#​7663](https://togithub.com/nextauthjs/next-auth/issues/7663)) - docs: Update refresh-token-rotation.md - fix example client code filename ([#​8088](https://togithub.com/nextauthjs/next-auth/issues/8088)) - docs(providers): updated docs with missing account attribute ([#​8084](https://togithub.com/nextauthjs/next-auth/issues/8084)) ### [`v4.22.3`](https://togithub.com/nextauthjs/next-auth/releases/tag/next-auth%404.22.3) [Compare Source](https://togithub.com/nextauthjs/next-auth/compare/next-auth@4.22.2...next-auth@4.22.3) **Full Changelog**: https://github.com/nextauthjs/next-auth/compare/next-auth@4.22.2...next-auth@4.22.3 ### [`v4.22.2`](https://togithub.com/nextauthjs/next-auth/releases/tag/next-auth%404.22.2) [Compare Source](https://togithub.com/nextauthjs/next-auth/compare/next-auth@4.22.1...next-auth@4.22.2) #### Bugfixes - **providers**: fix `nodemailer`/required types ([#​7950](https://togithub.com/nextauthjs/next-auth/issues/7950)) ([`f48eb04`](https://togithub.com/nextauthjs/next-auth/commit/f48eb047)) - **ts**: adapter interface ([#​8054](https://togithub.com/nextauthjs/next-auth/issues/8054)) ([`bd37c55`](https://togithub.com/nextauthjs/next-auth/commit/bd37c552)) - **ts**: add overloads to withAuth middleware ([#​7999](https://togithub.com/nextauthjs/next-auth/issues/7999)) ([`169a523`](https://togithub.com/nextauthjs/next-auth/commit/169a5230)) - respect protocol too, when host is trusted ([#​7214](https://togithub.com/nextauthjs/next-auth/issues/7214)) #### Other - remove unused TS types - merge changes back to v4 ([#​7430](https://togithub.com/nextauthjs/next-auth/issues/7430)) - rephrase

Configuration

πŸ“… Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

β™» 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.



This PR has been generated by Mend Renovate. View repository job log here.

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

github-actions[bot] commented 5 months ago

Thank you for following the naming conventions! πŸ™ Feel free to join our discord and post your PR link to collect XP and win prizes!