
Next.js Middleware Bypass Vulnerability
Next.js Middleware Bypass Vulnerability
Hands-On of CVE-2025-29927 vulnerability in Next.js application where the internal header x-middleware-subrequest can be used to bypass middleware authentication and restricted access.
Next.js use an internal header "x-middleware-subrequest" to prevent recursive requests from triggering infinite loops. The security vulnerability shows it's possible to skip running Middleware, which could allow requests to bypass critical checks—such as authorization, cookie validation—before reaching routes.
Next.Js 15.2.3, 14.2.25, 13.5.9, 12.3.5