CVE-2026-73421: Next auth Configuration Errors Can Cause Existence-based Vulnerability

CRITICAL
Advisory Identifier: GHSA-8fpg-xm3f-6cx3
CWE-285 CWE-636
Published
Advisory Summary

CVE-2026-73421 is a CRITICAL configuration errors can cause existence-based vulnerability (CWE-285: Improper Authorization) affecting Next auth libraries in the npm ecosystem. The issue involves configuration errors can cause existence-based auth checks to fail open (auth object populated with an error). Remediation is available by upgrading affected packages to version 5.0.0-beta.32.

CVE-2026-73421 at a Glance

CVE Identifier CVE-2026-73421
GHSA Identifier GHSA-8fpg-xm3f-6cx3
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-285: Improper Authorization
Affected Product Next auth
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-73421

To remediate this vulnerability, upgrade all affected Next auth dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

next-auth fixed: 5.0.0-beta.32
npm install next-auth@5.0.0-beta.32
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls next-auth

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-73421, inspect your project dependencies using npm:

npm ls next-auth

Analyze the terminal output to locate any version of Next auth in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.0.0-beta.32), your application is affected.

Note: The npm ls next-auth command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-285: Improper Authorization, where the product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action. In Next auth, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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](https://authjs.dev/getting-started/session-management/protecting) — 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`**: ```json { "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. ```ts // 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: ```sh npm i next-auth@beta ``` ```sh yarn add next-auth@beta ``` ```sh 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: ```ts // 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](https://authjs.dev/guides/role-based-access-control). ### References - Protecting resources / session management: https://authjs.dev/getting-started/session-management/protecting - Role-based access control (RBAC): https://authjs.dev/guides/role-based-access-control - Auth.js error reference: https://authjs.dev/reference/core/errors ### 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.

CVE-2026-73421 Affected Next auth Versions

1 component(s)
Fixed Versions:
5.0.0-beta.32
Product / Package Ecosystem Affected Versions Fixed Version
next-auth
npm
≥ 5.0.0-beta.0
< 5.0.0-beta.32
5.0.0-beta.32

References

Frequently Asked Questions

What is CVE-2026-73421?
CVE-2026-73421 is a security vulnerability in Next auth involving Configuration errors can cause existence-based auth checks to fail open (auth object populated with an error) under CWE-285: Improper Authorization.
Which Next auth versions are affected?
Affected versions include releases prior to 5.0.0-beta.32 across affected packages: next-auth.
What version fixes CVE-2026-73421?
Upgrading to 5.0.0-beta.32 (or the latest patched release for your respective branch) resolves the vulnerability.
Is next-auth affected?
Yes, next-auth is affected in releases prior to 5.0.0-beta.32. Upgrade your dependency to 5.0.0-beta.32 or later.
What CWE is associated with CVE-2026-73421?
CVE-2026-73421 is classified under CWE-285: Improper Authorization (The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.).
How can I check npm dependencies for CVE-2026-73421?
Run the dependency tree command: 'npm ls next-auth'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8fpg-xm3f-6cx3",
  "modified" : "2026-08-12T20:31:20Z",
  "published" : "2026-07-23T14:52:23Z",
  "aliases" : [ "CVE-2026-73421" ],
  "summary" : "Auth.js: Configuration errors can cause existence-based auth checks to fail open (auth object populated with an error)",
  "details" : "### Impact\n\n`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](https://authjs.dev/getting-started/session-management/protecting) — are affected.\n\nWhen 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`**:\n\n```json\n{ \"message\": \"There was a problem with the server configuration. Check the server logs for more information.\" }\n```\n\nBecause 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.\n\n```ts\n// middleware.ts — affected pattern\nexport default auth((req) => {\n  const { nextUrl, auth } = req\n  const isLoggedIn = !!auth // <-- always true when the configuration is broken\n  // ...\n})\n```\n\nA representative trigger is a provider that is missing required configuration. For example, a Keycloak provider with neither `issuer` nor `authorization` endpoint set logs:\n\n```\n[auth][error] InvalidEndpoints: Provider \"keycloak\" is missing both `issuer` and `authorization` endpoint config. At least one of them is required.\n```\n\n…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`).\n\nThere 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.\n\nThis is an instance of CWE-636 (Not Failing Securely / \"Failing Open\") leading to improper authorization (CWE-285).\n\n### Patches\n\nThe 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 -->`.\n\nTo upgrade:\n\n```sh\nnpm i next-auth@beta\n```\n```sh\nyarn add next-auth@beta\n```\n```sh\npnpm add next-auth@beta\n```\n\n### Workarounds\n\nIf 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:\n\n```ts\n// middleware.ts\nexport default auth((req) => {\n  // `auth.user` is only present on a real session; resilient to config-error objects\n  const isLoggedIn = !!req.auth?.user\n  // ...\n})\n```\n\nAs 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](https://authjs.dev/guides/role-based-access-control).\n\n### References\n\n- Protecting resources / session management: https://authjs.dev/getting-started/session-management/protecting\n- Role-based access control (RBAC): https://authjs.dev/guides/role-based-access-control\n- Auth.js error reference: https://authjs.dev/reference/core/errors\n\n### For more information\n\nIf you have any concerns, Auth.js requests responsible disclosure, outlined here: https://authjs.dev/security\n\n### Credits\n\nReported by @marc-zollingkoffer-syzygy.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "next-auth"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0-beta.0"
      }, {
        "fixed" : "5.0.0-beta.32"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.0.0-beta.31"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nextauthjs/next-auth/security/advisories/GHSA-8fpg-xm3f-6cx3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nextauthjs/next-auth/commit/d008b9b764bf4b322a87e1822d1dda7789258d8f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nextauthjs/next-auth"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nextauthjs/next-auth/releases/tag/next-auth@5.0.0-beta.32"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-285", "CWE-636" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-23T14:52:23Z",
    "nvd_published_at" : null
  }
}