CVE-2025-29927

Next.js Middleware Bypass: When 'I'm With The Band' Actually Works

Amit Schendel
Amit Schendel
Senior Security Researcher

Jan 12, 2026·5 min read·9 visits

Executive Summary (TL;DR)

By sending the `x-middleware-subrequest` header, attackers can trick the Next.js router into believing a request has already passed security checks. This bypasses authentication and access controls defined in `middleware.ts`. Patched versions introduce a server-side secret to validate this header.

A critical authorization bypass in the Next.js framework allows attackers to skip middleware execution entirely by injecting a specific internal HTTP header. This effectively removes the 'bouncer' from the door of your application, granting unauthorized access to protected routes.

Fix Analysis (2)

Technical Appendix

CVSS Score
9.1/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
EPSS Probability
92.90%
Top 0% most exploited

Affected Systems

Next.js Framework (Self-Hosted)Node.js Applications using Next.js MiddlewareDockerized Next.js deployments

Affected Versions Detail

Product
Affected Versions
Fixed Version
Next.js
Vercel
11.1.4 - 12.3.412.3.5
Next.js
Vercel
13.0.0 - 13.5.813.5.9
Next.js
Vercel
14.0.0 - 14.2.2414.2.25
Next.js
Vercel
15.0.0 - 15.2.215.2.3
AttributeDetail
CWE IDCWE-285 (Improper Authorization)
CVSS v3.19.1 (Critical)
Attack VectorNetwork (AV:N)
EPSS Score92.90%
Exploit StatusActive / High Availability
KEV StatusNot Listed (Monitoring Recommended)
CWE-285
Improper Authorization

The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.

Vulnerability Timeline

Fix commits pushed to repository
2025-03-17
Public disclosure (CVE-2025-29927)
2025-03-21
Public PoC exploits released
2025-03-24

Subscribe to updates

Get the latest CVE analysis reports delivered to your inbox.