CVE-2023-48309Nextauth.js Next-auth
Medium 5.3 No auth needed
Follow: this CVE · Nextauth.js · Nextauth.js Next-auth We alert you by email or Slack (account required).
- Priority
- 47
- CVSS 3.1
- 5.3
- EPSS
- 0.8% probability of exploitation in 30 days · percentile 54
- Auth required
- No
- Published
- Nov 20, 2023
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- SSVC (CISA)
- Exploitation: none · Automatable: yes · Technical impact: partial
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
What happens
NextAuth.js provides authentication for Next.js. `next-auth` applications prior to version 4.24.5 that rely on the default Middleware authorization are affected by a vulnerability. 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). `next-auth` `v4.24.5` contains a patch for the vulnerability. As a workaround, using a custom authorization callback for Middleware, developers can manually do a basic authentication.
What to do
- Apply the vendor's security update for Next-auth.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| npm | next-auth |
< 4.24.5 |
4.24.5 |
npm install next-auth@4.24.5 |
Per OSV / GitHub Advisories (GHSA-v64w-49xw-qq89). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| nextauth.js | next-auth | < 4.24.5 |
Official sources
References
Links published by the sources. Open them with care.
- authjs.dev Technical Description
- github.com Patch
- github.com Vendor Advisory
- next-auth.js.org Technical Description
- next-auth.js.org Technical Description