Skip to main content
EPSS 0.6%top 51%

CVE-2026-73421: CWE-285: Improper Authorization in nextauthjs next-auth

0
Critical
VulnerabilityCVE-2026-73421cvecve-2026-73421cwe-285cwe-636
Published: 08/13/2026 (08/13/2026, 22:04:36 UTC)
Source: CVE Database V5
Vendor/Project: nextauthjs
Product: 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

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
High
Vuln. Integrity
High
Vuln. Availability
None
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Affected software

nextauthjs

next-auth

Affected versions
>=5.0.0-beta.4 <5.0.0-beta.32
next-authjs/next-auth
pkg:npm/next-authjs/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

AILast updated: 08/21/2026, 13:04:11 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses