{"id":"CVE-2026-145493","summary":"next-auth 4.2.0 through 4.24.15 Authentication Bypass via withAuth Middleware Path Prefix","details":"next-auth 4.2.0 through 4.24.15 contains an authentication bypass vulnerability in the withAuth middleware handleMiddleware function due to unbounded startsWith prefix checks. Unauthenticated attackers can request routes like /api/authors or /_next-admin to skip session checks and the authorized callback, reaching middleware-protected routes.","modified":"2026-12-05T04:01:01.835193446Z","published":"2026-12-05T02:00:07.523Z","database_specific":{"cwe_ids":["CWE-187"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/145xxx/CVE-2026-145493.json","cna_assigner":"VulnCheck"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/145xxx/CVE-2026-145493.json"},{"type":"PACKAGE","url":"https://github.com/nextauthjs/next-auth"},{"type":"ARTICLE","url":"https://github.com/nextauthjs/next-auth/blob/next-auth%404.24.15/packages/next-auth/src/next/middleware.ts#L109-L119"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-145493"},{"type":"ADVISORY","url":"https://www.vulncheck.com/advisories/next-auth-4.2.0-through-4.24.15-authentication-bypass-via-withauth-middleware-path-prefix"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/nextauthjs/next-auth","events":[{"introduced":"f3be5e87f6fa2bdd6f633ed1adfa3bc59579eadc"},{"last_affected":"d857eec560fb99c8b18d3b22a2693b849a62d1c3"}],"database_specific":{"extracted_events":[{"range":[{"introduced":"4.2.0"},{"last_affected":"4.24.15"}],"source":"AFFECTED_FIELD","strategy":"StandardRange"}]}}],"versions":["next-auth@4.24.15","next-auth@4.24.14","next-auth@4.24.13","next-auth@4.24.12","next-auth@4.24.11","next-auth@4.24.10","next-auth@4.24.9","next-auth@4.24.8","next-auth@4.24.7","next-auth@4.24.6","next-auth@4.24.5","next-auth@4.24.4","next-auth@4.24.3","next-auth@4.24.2","next-auth@4.24.1","next-auth@4.24.0","next-auth@4.23.2","next-auth@4.23.1","next-auth@4.23.0","next-auth@4.22.5","next-auth@4.22.4","next-auth@4.22.3","next-auth@4.22.2","next-auth@4.21.1","next-auth@4.21.0","next-auth@4.20.1","next-auth@4.20.0","next-auth@4.19.2","next-auth@4.19.1","next-auth@4.19.0","next-auth@4.18.10","next-auth@4.18.9","next-auth@4.18.8","next-auth@v4.18.7","@auth/sveltekit@v0.1.1","@auth/core@v0.1.1","@auth/sveltekit@v0.1.0","@auth/core@v0.1.0","next-auth@v4.18.6","next-auth@v4.18.5","next-auth@v4.18.4","next-auth@v4.18.3","next-auth@v4.18.2","next-auth@v4.18.1","next-auth@v4.18.0","@next-auth/pouchdb-adapter@v.0.1.5","@next-auth/firebase-adapter@v1.0.3","next-auth@v4.17.0","@next-auth/supabase-adapter@v0.2.0","next-auth@v4.16.4","next-auth@v4.16.3","next-auth@v4.16.2","next-auth@v4.16.1","next-auth@v4.16.0","next-auth@v.4.15.2","next-auth@v4.15.1","@next-auth/xata-adapter@v0.2.0","next-auth@v4.15.0","next-auth@v4.14.0","next-auth@v4.13.0","@next-auth/upstash-redis-adapter@v3.0.3","@next-auth/typeorm-legacy-adapter@v2.0.1","@next-auth/sequelize-adapter@v1.0.6","@next-auth/prisma-adapter@v1.0.5","@next-auth/neo4j-adapter@v1.0.5","@next-auth/mongodb-adapter@v1.1.1","@next-auth/mikro-orm-adapter@v3.0.1","@next-auth/firebase-adapter@v1.0.2","@next-auth/dynamodb-adapter@v1.0.5","next-auth@v4.12.2","next-auth@v4.12.1","next-auth@v4.12.0","@next-auth/upstash-redis-adapter@v3.0.2","next-auth@v4.11.0","@next-auth/mongodb-adapter@v1.1.0","@next-auth/mikro-orm-adapter@v3.0.0","next-auth@v4.10.3","next-auth@v4.10.2","@next-auth/upstash-redis-adapter@v3.0.1","@next-auth/prisma-adapter@v1.0.4","@next-auth/prisma-adapter@1.0.4","@next-auth/pouchdb-adapter@v0.1.4","@next-auth/neo4j-adapter@v1.0.4","@next-auth/mongodb-adapter@v1.0.4","@next-auth/firebase-adapter@v1.0.1","@next-auth/fauna-adapter@v1.0.4","@next-auth/dynamodb-adapter@v1.0.4","@next-auth/dgraph-adapter@v1.0.4","next-auth@v4.10.1","next-auth@v4.10.0","@next-auth/typeorm-legacy-adapter@v2.0.0","@next-auth/sequelize-adapter@v1.0.5","@next-auth/firebase-adapter@v1.0.0","next-auth@v4.9.0","next-auth@v4.8.0","next-auth@v4.6.1","next-auth@v4.5.0","next-auth@v4.3.4","next-auth@v4.3.3","next-auth@v4.3.1","next-auth@v4.3.0","@next-auth/typeorm-legacy-adapter@v1.0.2","@next-auth/prisma-adapter@v1.0.2","@next-auth/mongodb-adapter@v1.0.2","@next-auth/mikro-orm-adapter@v2.0.0","v4.2.1","v4.2.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-145493.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N"}]}