{"id":"GHSA-xmf8-cvqr-rfgj","revision":"ddc6058253c0483498824977a073976c","records":[{"revision":"ddc6058253c0483498824977a073976c","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-xmf8-cvqr-rfgj","aliases":["CVE-2026-73418"],"title":"Auth.js: getToken() throws an uncaught exception on malformed Bearer authorization headers","description":"## 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.","state":0,"publishedAt":"2026-07-23T14:42:55+00:00","modifiedAt":"2026-09-10T03:51:12.5498677+00:00","affected":[{"ecosystem":"npm","name":"@auth/core","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0.1.0"},{"kind":"fixed","version":"0.41.3"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"next-auth","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"5.0.0-beta.0"},{"kind":"fixed","version":"5.0.0-beta.32"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"next-auth","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"4.0.6"},{"kind":"fixed","version":"4.24.15"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/nextauthjs/next-auth/security/advisories/GHSA-xmf8-cvqr-rfgj","https://nvd.nist.gov/vuln/detail/CVE-2026-73418","https://github.com/nextauthjs/next-auth/pull/13467","https://github.com/nextauthjs/next-auth/pull/13469","https://github.com/nextauthjs/next-auth/commit/5bca2399a79ba8d116ca5179b4b1ebcd152e7f05","https://github.com/nextauthjs/next-auth/commit/e707770f00c52b3479e43422b0200b059149ed53","https://github.com/nextauthjs/next-auth","https://github.com/nextauthjs/next-auth/releases/tag/@auth/core@0.41.3","https://github.com/nextauthjs/next-auth/releases/tag/next-auth@4.24.15","https://github.com/nextauthjs/next-auth/releases/tag/next-auth@5.0.0-beta.32"],"sourceUrl":"https://github.com/advisories/GHSA-xmf8-cvqr-rfgj","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-xmf8-cvqr-rfgj","identifiers":["GHSA-xmf8-cvqr-rfgj","CVE-2026-73418"]},"retained":false,"historicalAffected":[]}],"coverage":[]}