5.3
MEDIUM
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. 25, 2023, 2:18 a.m.

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.

Affected Products

The following products are affected by CVE-2023-48309 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Nextauth.js next-auth
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

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

Updated: 10 months ago
2 stars 0 fork 0 watcher
Born at : Nov. 26, 2023, 3:26 p.m. This repo has been linked 2 different CVEs too.

None

TypeScript CSS JavaScript

Updated: 2 months, 3 weeks ago
1 stars 0 fork 0 watcher
Born at : May 20, 2023, 9:07 p.m. This repo has been linked 1 different CVEs too.

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 [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
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.
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.06 }} 0.02%

score

0.25433

percentile

CVSS31 - Vulnerability Scoring System
Attack Vector
Attack Complexity
Privileges Required
User Interaction
Scope
Confidentiality
Integrity
Availability