CVE-2023-48309 json
next-auth vulnerable to possible user mocking that bypasses basic authentication
published 2023-11-20 2 y ago modified 2026-09-10 1 mo ago also GHSA-v64w-49xw-qq89 , EUVD-2023-3038
- cvss
- 5.3
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.7%
- EPSS 0.7% chance of exploitation in 30 days, percentile 53%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
CISA SSVC
- Exploitation
- none
- Automatable
- yes
- Technical impact
- partial
- Assessed
- 2 y ago
Exploit prediction
0.70% chance of exploitation in the next 30 days, higher than 53% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N |
| NVD | 3.1 | 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N |
| GitHub | 3.1 | 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | next-auth | <4.24.5 |
4.24.5 |
Affected products
- nextauthjs next-auth
Classification
References
-
github.com
/nextauthjs/next-auth/commit/d237059b6d0cb868c041ba18b698e0cee20a2f10
web, patch
-
github.com
/nextauthjs/next-auth/security/advisories/GHSA-v64w-49xw-qq89
web, vendor-advisory
-
authjs.dev
/guides/basics/role-based-access-control
web, technical-description
-
next-auth.js.org
/configuration/nextjs#advanced-usage
web, technical-description
-
next-auth.js.org
/configuration/nextjs#middlewar
web, technical-description
-
nvd.nist.gov
/vuln/detail/CVE-2023-48309
advisory
-
github.com
/nextauthjs/next-auth
package
Sources
- CVE List CVE-2023-48309
- GitHub Advisory GHSA-v64w-49xw-qq89
- NVD CVE-2023-48309
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.