CVE-2026-73421: CWE-285: Improper Authorization in nextauthjs next-auth
NextAuth.js provides authentication for Next.js. From next-auth 5.0.0-beta.0 until 5.0.0-beta.32, applications that gate access by checking only for the existence of the auth object returned by the auth() wrapper can fail open when Auth.js has a server configuration error. In middleware, Route Handlers, React Server Components, and other auth() entry points, a non-OK session response is parsed into a truthy error object instead of null, so checks such as !!auth and if (req.auth) evaluate to true for unauthenticated requests. A provider missing both the issuer and authorization endpoint triggers InvalidEndpoints, and an unset AUTH_SECRET or another server configuration error can produce the same behavior. There is no impact while configuration is valid, but after a deployment becomes misconfigured, routes protected only by session existence silently grant access to every visitor. This issue is fixed in next-auth 5.0.0-beta.32.
AI Analysis
Technical Summary
NextAuth.js, an authentication library for Next.js, has a critical improper authorization vulnerability (CWE-285) in versions 5.0.0-beta.0 through 5.0.0-beta.31. The vulnerability arises when server configuration errors cause the auth() wrapper to return a truthy error object instead of null for unauthenticated requests. Consequently, authorization checks that only verify the presence of the auth object (e.g., !!auth or if (req.auth)) mistakenly grant access to unauthenticated users. This can occur if a provider lacks both issuer and authorization endpoints or if the AUTH_SECRET environment variable is unset. The vulnerability is resolved in next-auth 5.0.0-beta.32.
Potential Impact
If the server configuration is invalid or misconfigured, routes protected solely by the existence of a session or auth object will grant access to all visitors, including unauthenticated users. This results in unauthorized access to protected resources. There is no impact when the configuration is valid. No known exploits in the wild have been reported.
Mitigation Recommendations
Upgrade to next-auth version 5.0.0-beta.32 or later, where this issue is fixed. Ensure that server configuration is valid, including setting the AUTH_SECRET and correctly configuring provider endpoints. Avoid relying solely on the existence of the auth object for authorization checks, and implement more robust validation of session status.
CVE-2026-73421: CWE-285: Improper Authorization in nextauthjs next-auth
Description
NextAuth.js provides authentication for Next.js. From next-auth 5.0.0-beta.0 until 5.0.0-beta.32, applications that gate access by checking only for the existence of the auth object returned by the auth() wrapper can fail open when Auth.js has a server configuration error. In middleware, Route Handlers, React Server Components, and other auth() entry points, a non-OK session response is parsed into a truthy error object instead of null, so checks such as !!auth and if (req.auth) evaluate to true for unauthenticated requests. A provider missing both the issuer and authorization endpoint triggers InvalidEndpoints, and an unset AUTH_SECRET or another server configuration error can produce the same behavior. There is no impact while configuration is valid, but after a deployment becomes misconfigured, routes protected only by session existence silently grant access to every visitor. This issue is fixed in next-auth 5.0.0-beta.32.
CVSS v4.0
Score 9.1critical
Affected software
nextauthjs
next-auth
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
NextAuth.js, an authentication library for Next.js, has a critical improper authorization vulnerability (CWE-285) in versions 5.0.0-beta.0 through 5.0.0-beta.31. The vulnerability arises when server configuration errors cause the auth() wrapper to return a truthy error object instead of null for unauthenticated requests. Consequently, authorization checks that only verify the presence of the auth object (e.g., !!auth or if (req.auth)) mistakenly grant access to unauthenticated users. This can occur if a provider lacks both issuer and authorization endpoints or if the AUTH_SECRET environment variable is unset. The vulnerability is resolved in next-auth 5.0.0-beta.32.
Potential Impact
If the server configuration is invalid or misconfigured, routes protected solely by the existence of a session or auth object will grant access to all visitors, including unauthenticated users. This results in unauthorized access to protected resources. There is no impact when the configuration is valid. No known exploits in the wild have been reported.
Mitigation Recommendations
Upgrade to next-auth version 5.0.0-beta.32 or later, where this issue is fixed. Ensure that server configuration is valid, including setting the AUTH_SECRET and correctly configuring provider endpoints. Avoid relying solely on the existence of the auth object for authorization checks, and implement more robust validation of session status.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-08-12T14:32:11.795Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a7e4130bf8831d539e05259
Added to database: 08/13/2026, 22:12:00 UTC
Last enriched: 08/21/2026, 13:04:11 UTC
Last updated: 09/29/2026, 01:47:44 UTC
Views: 158
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.