Authorization Bypass in Next.js Middleware
Package
Affected versions
>= 13.0.0, < 13.5.9
>= 14.0.0, < 14.2.25
>= 15.0.0, < 15.2.3
>= 11.1.4, < 12.3.5
Patched versions
13.5.9
14.2.25
15.2.3
12.3.5
Description
Published by the National Vulnerability Database
Mar 21, 2025
Published to the GitHub Advisory Database
Mar 21, 2025
Reviewed
Mar 21, 2025
Last updated
Mar 28, 2025
Impact
It is possible to bypass authorization checks within a Next.js application, if the authorization check occurs in middleware.
Patches
15.2.3
14.2.25
13.5.9
12.3.5
Note: Next.js deployments hosted on Vercel are automatically protected against this vulnerability.
Workaround
If patching to a safe version is infeasible, it is recommend that you prevent external user requests which contain the
x-middleware-subrequest
header from reaching your Next.js application.Credits
References