Vulnerability record · CVE-2025-29927 · published 21 March 2025
CVE-2025-29927: Next.js middleware authorization bypass via x-middleware-subrequest header
Vercel · Next.Js
Next.js versions from 1.11.4 up to (but not including) 12.3.5, 13.5.9, 14.2.25, and 15.2.3 allow authorization checks performed in middleware to be bypassed. An attacker can reach protected routes or actions that the middleware was meant to guard, which matters because middleware is a common place to enforce auth in Next.js apps.
Description
Next.js is a React framework for building full-stack web applications. Starting in version 1.11.4 and prior to versions 12.3.5, 13.5.9, 14.2.25, and 15.2.3, it is possible to bypass authorization checks within a Next.js application, if the authorization check occurs in middleware. 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. This vulnerability is fixed in 12.3.5, 13.5.9, 14.2.25, and 15.2.3.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Automated analysis
critical priorityCVSS 9.1 with network reachability, no authentication or interaction required, and an EPSS probability above 0.99 make this a high-urgency authorization bypass.
What it is
Next.js versions from 1.11.4 up to (but not including) 12.3.5, 13.5.9, 14.2.25, and 15.2.3 allow authorization checks performed in middleware to be bypassed. An attacker can reach protected routes or actions that the middleware was meant to guard, which matters because middleware is a common place to enforce auth in Next.js apps.
Impact
An attacker can skip middleware-based authorization and access functionality or data that should require authentication or specific privileges. The CVSS vector indicates high confidentiality and integrity impact with no availability impact.
Attack surface
Reachable over the network via HTTP requests to a vulnerable Next.js application; no authentication or user interaction is required per the CVSS vector (AV:N/AC:L/PR:N/UI:N). The flaw is triggered when authorization logic lives in middleware and the request carries the x-middleware-subrequest header.
Exploitation
Not listed in CISA KEV and no ransomware usage documented, but EPSS is very high (0.99225, 99.935th percentile), indicating strong likelihood of exploitation activity. References are patch, release note, vendor advisory and third-party advisory tags only, with no public exploit tag supplied.
What to do
- Upgrade Next.js to 12.3.5, 13.5.9, 14.2.25, or 15.2.3 (or later) as applicable to your major version.
- If patching is not immediately possible, block or strip external requests containing the x-middleware-subrequest header before they reach the Next.js application.
- Do not rely solely on middleware for authorization; enforce authorization checks in the route handlers, server actions, or API layer as defense in depth.
- Audit middleware-protected routes to identify which ones would be exposed if the bypass occurred, and prioritize those for patching.
- Monitor vendor advisory GHSA-f82v-jwr5-mffw and related release notes for updates.
Detection
- Search web/proxy logs for requests containing the x-middleware-subrequest header, especially from external clients.
- Alert on access to middleware-protected routes that lack a valid authenticated session.
- Review application logs for authorization decisions made only in middleware and correlate with unexpected access patterns.
- Baseline normal header sets and flag anomalous or unexpected x-middleware-* headers in inbound traffic.
This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.
Affected products
1 vulnerable configurations from NVD's CPE data, grouped by vendor and product.
References
| Link | Tags |
|---|---|
| https://github.com/vercel/next.js/commit/52a078da3884efe6501613c7834a3d02a91676d2 | Patch |
| https://github.com/vercel/next.js/commit/5fd3ae8f8542677c6294f32d18022731eab6fe48 | Patch |
| https://github.com/vercel/next.js/releases/tag/v12.3.5 | Release Notes |
| https://github.com/vercel/next.js/releases/tag/v13.5.9 | Release Notes |
| https://github.com/vercel/next.js/security/advisories/GHSA-f82v-jwr5-mffw | Vendor Advisory |
| http://www.openwall.com/lists/oss-security/2025/03/23/3 | Mailing ListThird Party Advisory |
| http://www.openwall.com/lists/oss-security/2025/03/23/4 | Mailing List |
| https://security.netapp.com/advisory/ntap-20250328-0002/ | Third Party Advisory |
Track CVE-2025-29927 inside VULONE
Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.
Related vulnerabilities
Same products first, then exploited flaws of the same weakness class.
Source: NIST National Vulnerability Database (record CVE-2025-29927), CISA KEV, FIRST EPSS (scores of 2026-09-22). This page is refreshed as NVD updates the record.