CVE-2023-48309
JavaScript vulnerability analysis and mitigation

Overview

NextAuth.js versions prior to 4.24.5 contain a vulnerability in applications that rely on the default Middleware authorization. The vulnerability (CVE-2023-48309) was disclosed on November 20, 2023, affecting the authentication mechanism in NextAuth.js, a popular authentication library for Next.js applications (GitHub Advisory).

Technical details

The vulnerability allows a malicious actor to create an empty/mock user by obtaining a NextAuth.js-issued JWT from an interrupted OAuth sign-in flow (state, PKCE or nonce). By manually overriding the 'next-auth.session-token' cookie value with this non-related JWT, an attacker can simulate a logged-in user state. The CVSS v3.1 score for this vulnerability is 5.3 (Medium), with the vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N (GitHub Advisory).

Impact

The impact of this vulnerability is limited as it does not provide access to other users' data or resources that require proper authorization via scopes or other means. The mock user created through this exploit has no associated information (no name, email, or access_token). However, attackers can use this vulnerability to view logged-in user states, such as dashboard layouts (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in next-auth version 4.24.5. Users should upgrade to this version or later using npm i next-auth@latest, yarn add next-auth@latest, or pnpm add next-auth@latest. As a workaround, developers can implement a custom authorization callback for Middleware to perform basic authentication by checking for the existence of any property besides 'value' on the token object (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-59532HIGH8.6
  • JavaScriptJavaScript
  • @openai/codex
NoYesSep 22, 2025
CVE-2025-59430HIGH8.2
  • JavaScriptJavaScript
  • @meshconnect/web-link-sdk
NoYesSep 22, 2025
CVE-2025-59433MEDIUM5.3
  • JavaScriptJavaScript
  • @conventional-changelog/git-client
NoYesSep 22, 2025
CVE-2025-59526LOW2.7
  • JavaScriptJavaScript
  • mailgen
NoYesSep 22, 2025
GHSA-g38c-wxjf-xrh6HIGHN/A
  • JavaScriptJavaScript
  • git-commiters
NoYesSep 22, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management