storm-software / stormstack

⚡The StormStack monorepo contains utility applications, tools, and various libraries used to create modern, scalable web applications⚡
https://stormstack.github.io/stormstack/
Apache License 2.0
6 stars 0 forks source link

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

Open renovate[bot] opened 6 months ago

renovate[bot] commented 6 months ago

This PR contains the following updates:

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

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

Configuration

📅 Schedule: Branch creation - "" (UTC), 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.



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

sonarcloud[bot] commented 6 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues

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

See analysis details on SonarCloud

socket-security[bot] commented 6 months ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher

🚮 Removed packages: npm/@angular-devkit/architect@0.1602.5, npm/@angular-devkit/core@16.2.5, npm/@angular-devkit/schematics@16.2.5

View full report↗︎