{"id":"CVE-2023-48309","published":"2023-11-20T18:25:01Z","modified":"2024-08-29T13:41:03Z","title":"next-auth vulnerable to possible user mocking that bypasses basic authentication","vendor":"nextauthjs","product":"next-auth","tier":"tail","description":{"text":"NextAuth.js provides authentication for Next.js. `next-auth` applications prior to version 4.24.5 that rely on the default Middleware authorization are affected by a vulnerability. A bad actor could create an empty/mock user, by getting hold of a NextAuth.js-issued JWT from an interrupted OAuth sign-in flow (state, PKCE or nonce). Manually overriding the `next-auth.session-token` cookie value with this non-related JWT would let the user simulate a logged in user, albeit having no user information associated with it. (The only property on this user is an opaque randomly generated string). This vulnerability does not give access to other users' data, neither to resources that require proper authorization via scopes or other means. The created mock user has no information associated with it (ie. no name, email, access_token, etc.) This vulnerability can be exploited by bad actors to peek at logged in user states (e.g. dashboard layout). `next-auth` `v4.24.5` contains a patch for the vulnerability. As a workaround, using a custom authorization callback for Middleware, developers can manually do a basic authentication.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.3,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00864,"percentile":0.59504,"provenance":"source"},"cwes":[{"id":"CWE-285","name":"Improper Authorization"},{"id":"CWE-863","name":"Incorrect Authorization"}],"references":[{"url":"https://github.com/nextauthjs/next-auth/security/advisories/GHSA-v64w-49xw-qq89","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/nextauthjs/next-auth/commit/d237059b6d0cb868c041ba18b698e0cee20a2f10","tags":["x_refsource_MISC"]},{"url":"https://authjs.dev/guides/basics/role-based-access-control","tags":["x_refsource_MISC"]},{"url":"https://next-auth.js.org/configuration/nextjs#advanced-usage","tags":["x_refsource_MISC"]},{"url":"https://next-auth.js.org/configuration/nextjs#middlewar","tags":["x_refsource_MISC"]}],"priority":{"score":15.6,"factors":[{"name":"EPSS percentile","points":11.9},{"name":"CVSS severity","points":3.71}]},"vendorSlug":"nextauthjs","affectedVersions":[{"vendor":"nextauthjs","product":"next-auth","versions":["< 4.24.5"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial","timestamp":"2024-08-29T13:40:21.107207Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"next-auth","vulnerableRanges":["<4.24.5"],"patched":["4.24.5"],"from":["GHSA-v64w-49xw-qq89"],"provenance":"source"}],"summary":{"text":"The flaw is in the default Middleware authorization of next-auth (the NextAuth.js authentication library for Next.js) in versions prior to 4.24.5, which lets a session be treated as authenticated without a real user behind it. An unauthenticated remote attacker can obtain a NextAuth.js-issued JWT from an interrupted OAuth sign-in flow, then overwrite the next-auth.session-token cookie with it to appear logged in as an empty user, which exposes only the logged-in state (such as dashboard layout) and no other users' data or scoped resources.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:38:15Z"},"euvd":{"id":"EUVD-2023-3038","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2022-31186","published":"2022-08-01","fixed":"4.10.2","kev":false},{"cve":"CVE-2022-35924","published":"2022-08-02","fixed":"4.10.3","kev":false},{"cve":"CVE-2023-27490","published":"2023-03-09","fixed":"4.20.1","kev":false,"link":{"from":"CVE-2023-27490","to":"CVE-2023-48309","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:next-auth","fromFixed":"4.20.1","toFixed":"4.24.5","daysApart":256}]}},{"cve":"CVE-2023-48309","published":"2023-11-20","fixed":"4.24.5","kev":false},{"cve":"CVE-2026-73418","published":"2026-08-12","fixed":"5.0.0-beta.32","kev":false},{"cve":"CVE-2026-73419","published":"2026-08-12","fixed":"5.0.0-beta.32","kev":false},{"cve":"CVE-2026-73420","published":"2026-08-13","fixed":"5.0.0-beta.32","kev":false}],"package":"npm:next-auth"}}