Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. @auth/core
  4. ›
  5. GHSA-xmf8-cvqr-rfgj

GHSA-xmf8-cvqr-rfgj: Auth.js: getToken() throws an uncaught exception on malformed Bearer authorization headers

July 23, 2026

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.

References

  • github.com/advisories/GHSA-xmf8-cvqr-rfgj
  • github.com/nextauthjs/next-auth/commit/5bca2399a79ba8d116ca5179b4b1ebcd152e7f05
  • github.com/nextauthjs/next-auth/commit/e707770f00c52b3479e43422b0200b059149ed53
  • github.com/nextauthjs/next-auth/pull/13467
  • github.com/nextauthjs/next-auth/pull/13469
  • github.com/nextauthjs/next-auth/releases/tag/@auth/core@0.41.3
  • github.com/nextauthjs/next-auth/releases/tag/next-auth@4.24.15
  • github.com/nextauthjs/next-auth/releases/tag/next-auth@5.0.0-beta.32
  • github.com/nextauthjs/next-auth/security/advisories/GHSA-xmf8-cvqr-rfgj

Code Behaviors & Features

Detect and mitigate GHSA-xmf8-cvqr-rfgj with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 0.1.0 before 0.41.3

Fixed versions

  • 0.41.3

Solution

Upgrade to version 0.41.3 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-20: Improper Input Validation

Source file

npm/@auth/core/GHSA-xmf8-cvqr-rfgj.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 08 Aug 2026 00:17:53 +0000.