Skip to content

chore(deps): Update dependency next-auth to v5.0.0-beta.32 [SECURITY] - #402

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-next-auth-vulnerability
Open

chore(deps): Update dependency next-auth to v5.0.0-beta.32 [SECURITY]#402
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-next-auth-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Oct 29, 2025

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
next-auth (source) 5.0.0-beta.295.0.0-beta.32 age confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


NextAuthjs Email misdelivery Vulnerability

GHSA-5jpx-9hw9-2fx4

More information

Details

Summary

NextAuth.js's email sign-in can be forced to deliver authentication emails to an attacker-controlled mailbox due to a bug in nodemailer's address parser used by the project (fixed in nodemailer v7.0.7). A crafted input such as:

"e@attacker.com"@victim.com

is parsed incorrectly and results in the message being delivered to e@attacker.com (attacker) instead of "<e@attacker.com>@victim.com" (the intended recipient at victim.com) in violation of RFC 5321/5322 semantics. This allows an attacker to receive login/verification links or other sensitive emails intended for the victim.

Affected NextAuthjs Version

≤ Version Afftected
4.24.11 Yes
5.0.0-beta.29 Yes
POC

Example Setup showing misdelivery of email

import NextAuth from "next-auth"
import Nodemailer from "next-auth/providers/nodemailer"
import { PrismaAdapter } from "@auth/prisma-adapter"
import { prisma } from "@/lib/prisma"

export const { handlers, auth, signIn, signOut } = NextAuth({
  adapter: PrismaAdapter(prisma),
  providers: [
    Nodemailer({
      server: {
        host: "127.0.0.1",
        port: 1025,
        ...
      },
      from: "noreply@authjs.dev",
    }),
  ],
  pages: {
    signIn: '/auth/signin',
    verifyRequest: '/auth/verify-request',
  },
})
POST /api/auth/signin/nodemailer HTTP/1.1
Accept-Encoding: gzip, deflate, br, zstd
Cache-Control: no-cache
Connection: keep-alive
Content-Length: 176
DNT: 1
Host: localhost:3000
Origin: http://localhost:3000
Pragma: no-cache
Referer: http://localhost:3000/auth/signin
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
accept: */*
accept-language: en-US,en;q=0.9,ta;q=0.8
content-type: application/x-www-form-urlencoded
sec-ch-ua: "Google Chrome";v="141", "Not?A_Brand";v="8", "Chromium";v="141"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Linux"
x-auth-return-redirect: 1

email=%22e%40attacker.coccm%22%40victim.com&csrfToken=90f5e6f48ab577ab011f212011862dcfe546459c23764cf891aab2d176f8d77a&callbackUrl=http%3A%2F%2Flocalhost%3A3000%2Fauth%2Fsignin
Screenshot from 2025-10-25 21-15-25 Screenshot from 2025-10-25 21-14-47
Mitigation

Update to nodemailer 7.0.7

Credits

https://zeropath.com/ Helped identify this security issue

Severity

  • CVSS Score: 6.9 / 10 (Medium)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:P

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Auth.js: OAuth state, nonce, and PKCE check cookies are not bound to the provider that created them

CVE-2026-73419 / GHSA-x445-f3h2-j279

More information

Details

Summary

Auth.js stores the OAuth/OIDC anti-CSRF checks (state, nonce, and the PKCE verifier) in global cookies that are not bound to the provider that created them. On callback, a check value minted during a sign-in started with one provider can satisfy the callback for a different provider, because the stored cookie is not verified against the callback provider's identity (provider id, issuer, client id, or redirect URI). In a multi-provider app that allows account linking while logged in, this provider-confusion / mix-up condition can let an attacker link their account at a second provider to a victim's user.

Am I affected?

You may be affected if all of the following hold:

  • You use next-auth <= 4.24.14 or >= 5.0.0-beta.1, <= 5.0.0-beta.31, or @auth/core <= 0.41.2.
  • You configure multiple OAuth/OIDC providers.
  • You allow users to link additional providers while logged in.
  • At least one configured provider's authorization request is observable by an attacker, and at least one target provider's callback can be satisfied without a PKCE verifier (i.e. it relies only on state or only on nonce).

You are not affected if you use a single OAuth provider, do not allow logged-in account linking, or all providers enforce PKCE.

Impact
  • Account-linking confusion: an attacker can get their account at a target provider linked to the victim's Auth.js user, granting the attacker persistent sign-in to the victim's account through that linked provider.
  • Exploitation requires luring the victim into starting a legitimate same-origin flow; it cannot be performed by cross-site request forgery alone, which reduces practical likelihood.
Patched version

The fix binds the OAuth check cookies to the provider/authorization flow that created them, so a callback cannot consume a check value minted for a different provider. Upgrade to the first releases containing this fix (pending; this advisory will be updated with exact patched versions before publication).

Workarounds

If you cannot upgrade immediately:

  • Enable PKCE (checks: ["pkce"], in addition to state/nonce) on every provider that supports it; PKCE blocks the practical code-swap variant because the attacker cannot observe the relying party's verifier.
  • Avoid offering logged-in account linking across multiple providers where one provider is lower-trust or attacker-observable.
  • Treat events.linkAccount as sensitive: add audit logging, user notification, or out-of-band confirmation so that any unexpected link is visible (defense-in-depth, not a root-cause fix).
Credit

Reported by @​Nadav0077. Thank you for the responsible disclosure.

Severity

  • CVSS Score: 6.8 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Auth.js: Email normalizer validates the address before Unicode normalization, allowing a homoglyph @​ bypass

CVE-2026-73420 / GHSA-7rqj-j65f-68wh

More information

Details

Summary

The default email-address normalizer used by the email/magic-link sign-in flow validates the address before applying Unicode normalization. An address can contain a Unicode character that is not an ASCII @ (U+0040) but canonicalizes to one under NFKC/NFKD normalization (the normalization commonly applied by mail libraries and services for internationalized email). Such an address passes the normalizer's single-@ check, but a downstream mail library that normalizes the string then sees two @ separators and may deliver the passwordless sign-in link to a different recipient than intended. This is an instance of validating before canonicalizing.

Am I affected?

You may be affected if all of the following hold:

  • You use next-auth >= 4.0.0, < 4.24.14, or @auth/core >= 0.1.0, < 0.41.3.
  • You have the email / magic-link (passwordless) provider enabled.
  • You rely on the built-in default identifier normalizer (you have not supplied your own normalizeIdentifier).
  • Your sendVerificationRequest implementation uses a mail library or delivery service that applies Unicode normalization to recipient addresses (most internationalized-email/SMTPUTF8-capable senders do).

You are not affected if you do not use the email provider, or if your normalizer/mailer rejects or canonicalizes non-ASCII addresses before they are validated.

Impact
  • Account takeover: an attacker who knows a victim's email address can request a magic link that is delivered to an attacker-controlled mailbox, then use it to sign in as the victim.
  • No victim interaction is required to misroute the link; the attacker initiates the flow.
Patched version

The fix applies Unicode (NFKC) normalization before the address is validated, so homoglyph separators are collapsed and rejected up front. Upgrade to the first release containing this fix (pending; this advisory will be updated with the exact patched version before publication). No application code changes are required after upgrading.

Workarounds

If you cannot upgrade immediately:

  • Supply a custom normalizeIdentifier on the email provider that calls identifier.normalize("NFKC") (and lower-cases/trims) before any validation, and rejects addresses that do not contain exactly one @ after normalization.
  • Or reject any address whose local part or domain contains non-ASCII characters, if your user base does not require internationalized email addresses.
Credit

Reported by @​kakashi-kx. Thank you for the responsible disclosure.

Severity

  • CVSS Score: 9.1 / 10 (Critical)
  • Vector String: 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

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Auth.js: getToken() throws an uncaught exception on malformed Bearer authorization headers

CVE-2026-73418 / GHSA-xmf8-cvqr-rfgj

More information

Details

Summary

The exported getToken() helper (next-auth/jwt and @auth/core/jwt) can throw an uncaught exception when it reads a malformed Authorization: Bearer … header. When no session cookie is present, getToken() URL-decodes the bearer value before validating it, and malformed percent-encoding causes the decode step to throw rather than being treated as an invalid token. Because getToken() is commonly called in API routes, middleware, and other request handlers, a single unauthenticated request can trigger an unhandled exception in code paths that authenticate requests.

Am I affected?

You are affected if all of the following hold:

  • You use next-auth <= 5.0.0-beta.25 (or @auth/core exposing the same getToken() implementation).
  • Your application calls getToken() directly — for example in a Route Handler, middleware, or server-side request handler.
  • You do not wrap that getToken() call in your own try/catch.

You are not affected if you only use the framework's auth() helper and never call getToken() yourself, or if every getToken() call site already has its own exception handling.

Impact
  • Denial of service: an unauthenticated request carrying a malformed Bearer authorization header can raise an unhandled exception in any handler that calls getToken().
  • The impact is per-request and limited to availability; it does not expose tokens, sessions, or other data, and does not bypass authentication.

CWE-20: Improper Input Validation.

Patched version

The fix makes getToken() treat a malformed Bearer value as an invalid token and return null, matching how other undecodable tokens are already handled. Upgrade to the first release containing this fix (to be published; this advisory will be updated with the exact patched version before publication) and no code changes are required.

Workarounds

If you cannot upgrade immediately, either:

  • Config/code-level: wrap your getToken() calls so a thrown error is treated as "no token", e.g.

    let token = null
    try {
      token = await getToken({ req, secret })
    } catch {
      token = null
    }
  • Or strip/normalize the incoming Authorization header at the edge (proxy, middleware) before it reaches getToken(), rejecting values whose Bearer portion is not valid percent-encoding.

Credit

Reported by @​deprrous. Thank you for the responsible disclosure.

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Auth.js: Configuration errors can cause existence-based auth checks to fail open (auth object populated with an error)

CVE-2026-73421 / GHSA-8fpg-xm3f-6cx3

More information

Details

Impact

next-auth (Auth.js) v5 applications that gate access by checking only for the existence of the auth object — the pattern shown in the official session management / protecting resources guide — are affected.

When the Auth.js configuration produces a server-side error, the auth object exposed by the auth() wrapper (in middleware, Route Handlers, etc.) is populated with an error object instead of being null:

{ "message": "There was a problem with the server configuration. Check the server logs for more information." }

Because this object is truthy, any authorization check of the form !!auth (or if (req.auth)) evaluates to true for every request, including unauthenticated ones. The application fails open: instead of denying access when the auth layer is broken, it grants access to everyone.

// middleware.ts — affected pattern
export default auth((req) => {
  const { nextUrl, auth } = req
  const isLoggedIn = !!auth // <-- always true when the configuration is broken
  // ...
})

A representative trigger is a provider that is missing required configuration. For example, a Keycloak provider with neither issuer nor authorization endpoint set logs:

[auth][error] InvalidEndpoints: Provider "keycloak" is missing both `issuer` and `authorization` endpoint config. At least one of them is required.

…and from that point on auth is the error object above, so !!auth is permanently true. The same fail-open behavior occurs for other server-configuration errors (for example, an unset AUTH_SECRET).

There is no impact while the configuration is valid. The risk materializes when a previously-working deployment becomes misconfigured — e.g. an environment variable is changed or removed during a deploy — at which point existence-based auth checks silently stop protecting routes and all visitors are treated as authenticated. Because the failure mode is silent and grants access to everyone, the consequences can be severe.

This is an instance of CWE-636 (Not Failing Securely / "Failing Open") leading to improper authorization (CWE-285).

Patches

The fix ensures that a server-configuration error no longer surfaces as a truthy auth object: existence checks fail closed rather than open. This is released in next-auth@<!-- TODO: set patched version on publish -->.

To upgrade:

npm i next-auth@beta
yarn add next-auth@beta
pnpm add next-auth@beta
Workarounds

If you cannot upgrade immediately, check for a concrete user/session property rather than the bare object, so a configuration-error object is not treated as an authenticated session:

// middleware.ts
export default auth((req) => {
  // `auth.user` is only present on a real session; resilient to config-error objects
  const isLoggedIn = !!req.auth?.user
  // ...
})

As defense in depth, make Auth.js configuration errors fail loudly in your deployment pipeline (for example, treat [auth][error] log lines as a failed health check) so a broken configuration cannot silently reach production. As always, an existing session indicates authentication only — for authorization, perform an explicit role/permission check rather than relying on session existence. See the role-based access control guide.

References
For more information

If you have any concerns, Auth.js requests responsible disclosure, outlined here: https://authjs.dev/security

Credits

Reported by @​marc-zollingkoffer-syzygy.

Severity

  • CVSS Score: 9.1 / 10 (Critical)
  • Vector String: 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

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

nextauthjs/next-auth (next-auth)

v5.0.0-beta.32

Compare Source

Beta release for the v5 line.

Picks up the @​auth/core@​0.41.3 security fixes (malformed Bearer token handling in getToken, provider-bound OAuth check cookies, and NFKC email normalization).

Fixes auth checks failing open on provider configuration errors: a non-OK session response now yields no session instead of an error object, so checks like !!auth fail closed.

v5.0.0-beta.31

Compare Source

Bugfixes (via @​auth/core@​0.41.2)

  • providers: add issuer to GitHub provider for RFC 9207 compliance (#​13410).
    • Supports both github.com and GitHub Enterprise Server (dynamic ${baseUrl}/login/oauth).
  • signin/send-token: stricter email address validation (rejects quoted, multi-@, and empty-domain inputs).

Dependency bump

  • @auth/core: 0.41.00.41.2. Resolves a peer-dep inconsistency in 5.0.0-beta.30 where next-auth declared nodemailer: ^7.0.7 while pinning @auth/core@0.41.0 (which wanted ^6.8.0). Both now align at ^7.0.7.

No changes to next-auth's own source.

v5.0.0-beta.30

Compare Source


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot requested a review from ABGEO as a code owner October 29, 2025 14:08
@renovate
renovate Bot enabled auto-merge (squash) October 29, 2025 14:09
@renovate
renovate Bot force-pushed the renovate/npm-next-auth-vulnerability branch from 72e4d69 to 8b7b903 Compare December 31, 2025 12:53
@renovate
renovate Bot force-pushed the renovate/npm-next-auth-vulnerability branch from 8b7b903 to d56a28c Compare February 12, 2026 12:07
@renovate
renovate Bot force-pushed the renovate/npm-next-auth-vulnerability branch from d56a28c to bef651e Compare March 5, 2026 20:12
@renovate renovate Bot changed the title chore(deps): Update dependency next-auth to v5.0.0-beta.30 [SECURITY] chore(deps): Update dependency next-auth to v5.0.0-beta.30 [SECURITY] - autoclosed Mar 27, 2026
@renovate renovate Bot closed this Mar 27, 2026
auto-merge was automatically disabled March 27, 2026 01:35

Pull request was closed

@renovate
renovate Bot deleted the renovate/npm-next-auth-vulnerability branch March 27, 2026 01:35
@renovate renovate Bot changed the title chore(deps): Update dependency next-auth to v5.0.0-beta.30 [SECURITY] - autoclosed chore(deps): Update dependency next-auth to v5.0.0-beta.30 [SECURITY] Mar 30, 2026
@renovate renovate Bot reopened this Mar 30, 2026
@renovate
renovate Bot force-pushed the renovate/npm-next-auth-vulnerability branch 2 times, most recently from bef651e to c772271 Compare March 30, 2026 20:46
@renovate renovate Bot changed the title chore(deps): Update dependency next-auth to v5.0.0-beta.30 [SECURITY] chore(deps): Update dependency next-auth to v5.0.0-beta.30 [SECURITY] - autoclosed Apr 27, 2026
@renovate renovate Bot closed this Apr 27, 2026
@renovate renovate Bot changed the title chore(deps): Update dependency next-auth to v5.0.0-beta.30 [SECURITY] - autoclosed chore(deps): Update dependency next-auth to v5.0.0-beta.30 [SECURITY] Apr 27, 2026
@renovate renovate Bot reopened this Apr 27, 2026
@renovate
renovate Bot force-pushed the renovate/npm-next-auth-vulnerability branch 2 times, most recently from c772271 to c20b813 Compare April 27, 2026 22:31
@renovate
renovate Bot enabled auto-merge (squash) May 12, 2026 15:01
@renovate
renovate Bot force-pushed the renovate/npm-next-auth-vulnerability branch from c20b813 to 86b2ec8 Compare May 12, 2026 15:01
@renovate
renovate Bot force-pushed the renovate/npm-next-auth-vulnerability branch from 86b2ec8 to 2a72fb9 Compare July 12, 2026 15:32
@renovate
renovate Bot force-pushed the renovate/npm-next-auth-vulnerability branch from 2a72fb9 to 80efdfa Compare August 12, 2026 03:48
@renovate
renovate Bot force-pushed the renovate/npm-next-auth-vulnerability branch from 80efdfa to db57d2b Compare August 26, 2026 18:00
@renovate renovate Bot changed the title chore(deps): Update dependency next-auth to v5.0.0-beta.30 [SECURITY] chore(deps): Update dependency next-auth to v5.0.0-beta.32 [SECURITY] Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants