Nextauthjs next-auth
NextAuth.js: Configuration errors can cause existence-based auth checks to fail open (auth object populated with an error)
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.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 5.0.0-beta.4, < 5.0.0-beta.32
Fixed in 5.0.0-beta.32
Mitigation
Upgrade next-auth to 5.0.0-beta.32 or later.
References
- Vendor advisory github.com/nextauthjs/next-auth/security/advis…
- Patch github.com/nextauthjs/next-auth/commit/d008b9b…
- Release notes github.com/nextauthjs/next-auth/releases/tag/n…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.