CVE-2026-145493: next-auth 4.2.0 through 4.24.15 Authentication Bypass via withAuth Middleware Path Prefix

Published Dec 5, 2026
·
Updated

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.

Affected Software

1 affected component
npm/next-auth>=4.2.0<=4.24.15

Event History

Dec 5, 2026
CVE Published
via MITRE·02:00 AM
Data Sourced
via MITRE·02:00 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:20 AM
DescriptionSeverityWeakness
Event
via NVD·03:20 AM

Frequently Asked Questions

1

Which deployments are exposed to this bypass?

Deployments using npm/next-auth versions 4.2.0 through 4.24.15 and relying on the withAuth middleware to enforce session checks or an authorized callback on protected routes are exposed. Routes whose paths begin with an excluded authentication or Next.js internal path prefix may be reachable without authentication.

2

What does an attacker need to exploit the issue?

An attacker does not need credentials or user interaction. Exploitation requires sending a request to a path that shares a prefix with a path excluded by the middleware, such as /api/authors or /_next-admin.

3

How can I determine whether a route is vulnerable?

Review middleware-protected routes and test whether a request to a similarly prefixed path can reach the route without a session. In particular, check paths beginning with /api/auth or /_next that are not themselves intended exclusions, and verify that the authorized callback is invoked.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203