CVE-2023-48309
NextAuth.js JWT Token Hijacking Vulnerability
Description
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.
INFO
Published Date :
Nov. 20, 2023, 7:15 p.m.
Last Modified :
Nov. 21, 2024, 8:31 a.m.
Source :
[email protected]
Remotely Exploitable :
Yes !
Impact Score :
1.4
Exploitability Score :
3.9
Public PoC/Exploit Available at Github
CVE-2023-48309 has a 2 public PoC/Exploit
available at Github.
Go to the Public Exploits
tab to see the list.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2023-48309
.
URL | Resource |
---|---|
https://authjs.dev/guides/basics/role-based-access-control | Technical Description |
https://github.com/nextauthjs/next-auth/commit/d237059b6d0cb868c041ba18b698e0cee20a2f10 | Patch |
https://github.com/nextauthjs/next-auth/security/advisories/GHSA-v64w-49xw-qq89 | Vendor Advisory |
https://next-auth.js.org/configuration/nextjs#advanced-usage | Technical Description |
https://next-auth.js.org/configuration/nextjs#middlewar | Technical Description |
https://authjs.dev/guides/basics/role-based-access-control | Technical Description |
https://github.com/nextauthjs/next-auth/commit/d237059b6d0cb868c041ba18b698e0cee20a2f10 | Patch |
https://github.com/nextauthjs/next-auth/security/advisories/GHSA-v64w-49xw-qq89 | Vendor Advisory |
https://next-auth.js.org/configuration/nextjs#advanced-usage | Technical Description |
https://next-auth.js.org/configuration/nextjs#middlewar | Technical Description |
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
CVEs Proof-of-Concept
None
TypeScript CSS JavaScript
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2023-48309
vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2023-48309
vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Modified by af854a3a-2127-422b-91ae-364da2661108
Nov. 21, 2024
Action Type Old Value New Value Added Reference https://authjs.dev/guides/basics/role-based-access-control Added Reference https://github.com/nextauthjs/next-auth/commit/d237059b6d0cb868c041ba18b698e0cee20a2f10 Added Reference https://github.com/nextauthjs/next-auth/security/advisories/GHSA-v64w-49xw-qq89 Added Reference https://next-auth.js.org/configuration/nextjs#advanced-usage Added Reference https://next-auth.js.org/configuration/nextjs#middlewar -
CVE Modified by [email protected]
May. 14, 2024
Action Type Old Value New Value -
Initial Analysis by [email protected]
Nov. 25, 2023
Action Type Old Value New Value Added CVSS V3.1 NIST AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N Changed Reference Type https://authjs.dev/guides/basics/role-based-access-control No Types Assigned https://authjs.dev/guides/basics/role-based-access-control Technical Description Changed Reference Type https://github.com/nextauthjs/next-auth/commit/d237059b6d0cb868c041ba18b698e0cee20a2f10 No Types Assigned https://github.com/nextauthjs/next-auth/commit/d237059b6d0cb868c041ba18b698e0cee20a2f10 Patch Changed Reference Type https://github.com/nextauthjs/next-auth/security/advisories/GHSA-v64w-49xw-qq89 No Types Assigned https://github.com/nextauthjs/next-auth/security/advisories/GHSA-v64w-49xw-qq89 Vendor Advisory Changed Reference Type https://next-auth.js.org/configuration/nextjs#advanced-usage No Types Assigned https://next-auth.js.org/configuration/nextjs#advanced-usage Technical Description Changed Reference Type https://next-auth.js.org/configuration/nextjs#middlewar No Types Assigned https://next-auth.js.org/configuration/nextjs#middlewar Technical Description Added CPE Configuration OR *cpe:2.3:a:nextauth.js:next-auth:*:*:*:*:*:node.js:*:* versions up to (excluding) 4.24.5 -
CVE Received by [email protected]
Nov. 20, 2023
Action Type Old Value New Value Added Description 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. Added Reference GitHub, Inc. https://github.com/nextauthjs/next-auth/security/advisories/GHSA-v64w-49xw-qq89 [No types assigned] Added Reference GitHub, Inc. https://github.com/nextauthjs/next-auth/commit/d237059b6d0cb868c041ba18b698e0cee20a2f10 [No types assigned] Added Reference GitHub, Inc. https://authjs.dev/guides/basics/role-based-access-control [No types assigned] Added Reference GitHub, Inc. https://next-auth.js.org/configuration/nextjs#advanced-usage [No types assigned] Added Reference GitHub, Inc. https://next-auth.js.org/configuration/nextjs#middlewar [No types assigned] Added CWE GitHub, Inc. CWE-285 Added CWE GitHub, Inc. CWE-863 Added CVSS V3.1 GitHub, Inc. AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2023-48309
is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2023-48309
weaknesses.
Exploit Prediction
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days.
0.08 }} 0.01%
score
0.37679
percentile