Critical Next.js Middleware Bypass Enables Authorization Evasion
Vulnerability Disclosure · 4 sources · Updated 3mo ago · First seen Mar 25, 2025

A critical vulnerability in Next.js tracked as CVE-2025-29927 allows attackers to bypass authorization controls when applications rely on Middleware for access checks under specific deployment conditions. Researchers showed that specially crafted requests using the x-middleware-subrequest header can cause Middleware processing to be skipped, forwarding requests directly to protected endpoints. The issue was described as an authorization bypass with a CVSS 9.1 severity rating and was later detailed by the Next.js team in a postmortem.
The flaw affects multiple Next.js release lines, with fixes released in 15.2.3, 14.2.25, 13.5.9, and 12.3.5. Guidance from defenders and the vendor says organizations should patch immediately, and those unable to update should block external requests containing the x-middleware-subrequest header. The exposure is tied to applications run with next start using the output: 'standalone' setting, while hosted Next.js deployments on Vercel and Netlify were reported as protected from this issue.

