CVE-2026-73418: @auth/core GetToken() Throws An Uncaught Exception Vulnerability

HIGH
Advisory Identifier: GHSA-xmf8-cvqr-rfgj
CVSS 7.5
CWE-20
Published
Advisory Summary

CVE-2026-73418 is a HIGH (CVSS 7.5) gettoken() throws an uncaught exception vulnerability (CWE-20: Improper Input Validation) affecting @auth/core libraries in the npm ecosystem. The issue involves gettoken() throws an uncaught exception on malformed bearer authorization headers. Remediation is available by upgrading affected packages to version 0.41.3, 5.0.0-beta.32, 4.24.15.

CVE-2026-73418 at a Glance

CVE Identifier CVE-2026-73418
GHSA Identifier GHSA-xmf8-cvqr-rfgj
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-20: Improper Input Validation
Affected Product @auth/core
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-73418

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

@auth/core fixed: 0.41.3
npm install @auth/core@0.41.3
next-auth fixed: 5.0.0-beta.32
npm install next-auth@5.0.0-beta.32
next-auth fixed: 4.24.15
npm install next-auth@4.24.15
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 @auth/core

How to Check if You Are Affected

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

npm ls @auth/core

Analyze the terminal output to locate any version of @auth/core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.41.3), your application is affected.

Note: The npm ls @auth/core 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In @auth/core, 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

## 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. ```ts 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.

CVE-2026-73418 Affected @auth/core Versions

3 component(s)
Fixed Versions:
0.41.35.0.0-beta.324.24.15
Product / Package Ecosystem Affected Versions Fixed Version
@auth/core
npm
≥ 0.1.0
< 0.41.3
0.41.3
next-auth
npm
≥ 5.0.0-beta.0
< 5.0.0-beta.32
5.0.0-beta.32
next-auth
npm
≥ 4.0.6
< 4.24.15
4.24.15

References

Frequently Asked Questions

What is CVE-2026-73418?
CVE-2026-73418 is a security vulnerability in @auth/core involving getToken() throws an uncaught exception on malformed Bearer authorization headers under CWE-20: Improper Input Validation.
Which @auth/core versions are affected?
Affected versions include releases prior to 0.41.3, 5.0.0-beta.32, 4.24.15 across affected packages: @auth/core, next-auth.
What version fixes CVE-2026-73418?
Upgrading to 0.41.3, 5.0.0-beta.32, 4.24.15 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @auth/core affected?
Yes, @auth/core is affected in releases prior to 0.41.3. Upgrade your dependency to 0.41.3 or later.
Is next-auth affected?
Yes, next-auth is affected in releases prior to 5.0.0-beta.32, 4.24.15. Upgrade your dependency to 5.0.0-beta.32, 4.24.15 or later.
What is the CVSS score of CVE-2026-73418?
CVE-2026-73418 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-73418?
CVE-2026-73418 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check npm dependencies for CVE-2026-73418?
Run the dependency tree command: 'npm ls @auth/core'. 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-xmf8-cvqr-rfgj",
  "modified" : "2026-08-13T19:05:18Z",
  "published" : "2026-07-23T14:42:55Z",
  "aliases" : [ "CVE-2026-73418" ],
  "summary" : "Auth.js: getToken() throws an uncaught exception on malformed Bearer authorization headers",
  "details" : "## Summary\n\nThe 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.\n\n## Am I affected?\n\nYou are affected if **all** of the following hold:\n\n- You use `next-auth` `<= 5.0.0-beta.25` (or `@auth/core` exposing the same `getToken()` implementation).\n- Your application calls `getToken()` directly — for example in a Route Handler, middleware, or server-side request handler.\n- You do not wrap that `getToken()` call in your own `try/catch`.\n\nYou 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.\n\n## Impact\n\n- Denial of service: an unauthenticated request carrying a malformed Bearer authorization header can raise an unhandled exception in any handler that calls `getToken()`.\n- The impact is per-request and limited to availability; it does not expose tokens, sessions, or other data, and does not bypass authentication.\n\nCWE-20: Improper Input Validation.\n\n## Patched version\n\nThe 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.\n\n## Workarounds\n\nIf you cannot upgrade immediately, either:\n\n- **Config/code-level:** wrap your `getToken()` calls so a thrown error is treated as \"no token\", e.g.\n\n  ```ts\n  let token = null\n  try {\n    token = await getToken({ req, secret })\n  } catch {\n    token = null\n  }\n  ```\n\n- 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.\n\n## Credit\n\nReported by @deprrous. Thank you for the responsible disclosure.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@auth/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.1.0"
      }, {
        "fixed" : "0.41.3"
      } ]
    } ]
  }, {
    "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"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "next-auth"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.6"
      }, {
        "fixed" : "4.24.15"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.24.14"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nextauthjs/next-auth/security/advisories/GHSA-xmf8-cvqr-rfgj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-73418"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nextauthjs/next-auth/pull/13467"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nextauthjs/next-auth/pull/13469"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nextauthjs/next-auth/commit/5bca2399a79ba8d116ca5179b4b1ebcd152e7f05"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nextauthjs/next-auth/commit/e707770f00c52b3479e43422b0200b059149ed53"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nextauthjs/next-auth"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nextauthjs/next-auth/releases/tag/@auth/core@0.41.3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nextauthjs/next-auth/releases/tag/next-auth@4.24.15"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nextauthjs/next-auth/releases/tag/next-auth@5.0.0-beta.32"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-23T14:42:55Z",
    "nvd_published_at" : "2026-08-12T21:17:40Z"
  }
}