Summary
CVE-2025-29927 is a critical authorization bypass vulnerability in Next.js. Applications may be affected when authorization checks are implemented in Next.js middleware, allowing a remote unauthenticated attacker to bypass those checks.
Technical details
-
Root cause: improper authorization handling in Next.js middleware.
-
Trigger conditions: the application performs authorization checks in middleware.
-
Attack vector: network-based exploitation using HTTP requests that include the
x-middleware-subrequestheader. -
Impact: bypass of middleware-based authorization checks, with high confidentiality and integrity impact.
Affected software
-
Next.js versions >= 11.1.4 and < 12.3.5
-
Next.js versions >= 13.0.0 and < 13.5.9
-
Next.js versions >= 14.0.0 and < 14.2.25
-
Next.js versions >= 15.0.0 and < 15.2.3
Severity
CVSS v3.1 base score: 9.1 Critical
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Mitigation and recommended actions
-
Immediate: upgrade Next.js to 12.3.5, 13.5.9, 14.2.25, or 15.2.3, depending on the deployed major version.
-
If patching is not immediately feasible: prevent external user requests containing the
x-middleware-subrequestheader from reaching the Next.js application.

