Description
NextAuth.js provides authentication for Next.js. Prior to @auth/core 0.41.3 and next-auth 4.24.15 and 5.0.0-beta.32, the exported getToken() helper in the next-auth/jwt and @auth/core/jwt modules 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 decodeURIComponent() to throw instead of treating the token as invalid. Because getToken() is commonly called in API routes, middleware, and server-side request handlers, a single unauthenticated request can trigger an unhandled exception in code paths that authenticate requests, causing a per-request denial of service without exposing tokens, sessions, or other data and without bypassing authentication. This issue is fixed in @auth/core 0.41.3 and next-auth 4.24.15 and 5.0.0-beta.32.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| nextauthjs | next-auth | >= 4.0.6, <= 4.24.14, >= 5.0.0-beta.0, <= 5.0.0-beta.31 | — |
| @auth | core | >= 0.1.0, < 0.41.3 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Wolfi
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | jitsucom-jitsu-console | 2.11.0-r30 | — |
| Wolfi rolling | langfuse-3 +1 | 3.224.3-r0 | — |
| Wolfi rolling | langfuse-3-compat | 3.225.7-r6 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| npm | @auth/core | >= 0.1.0, < 0.41.3 | 0.41.3 | GHSA-xmf8-cvqr-rfgj |
| npm | next-auth | >= 5.0.0-beta.0, < 5.0.0-beta.32 | 5.0.0-beta.32 | GHSA-xmf8-cvqr-rfgj |
| npm | next-auth | >= 4.0.6, < 4.24.15 | 4.24.15 | GHSA-xmf8-cvqr-rfgj |
References
- https://github.com/nextauthjs/next-auth/security/advisories/GHSA-xmf8-cvqr-rfgj
- 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/releases/tag/%40auth%2Fcore%400.41.3
- https://github.com/nextauthjs/next-auth/releases/tag/next-auth%404.24.15
- https://github.com/nextauthjs/next-auth/releases/tag/next-auth%405.0.0-beta.32