Authorization Bypass in Next.js Middleware
Impact
It is possible to bypass authorization checks within a Next.js application, if the authorization check occurs in middleware.
Patches
- For Next.js 15.x, this issue is fixed in
15.2.3 - For Next.js 14.x, this issue is fixed in
14.2.25 - For Next.js 13.x, this issue is fixed in 13.5.9
- For Next.js 12.x, this issue is fixed in 12.3.5
- For Next.js 11.x, consult the below workaround.
Note: Next.js deployments hosted on Vercel are automatically protected against this vulnerability.
Workaround
If patching to a safe version is infeasible, we recommend that you prevent external user requests which contain the x-middleware-subrequest header from reaching your Next.js application.
Credits
- Allam Rachid (zhero;)
- Allam Yasser (inzo_)
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | next | >= 13.0.0, < 13.5.9, >= 14.0.0, < 14.2.25, >= 15.0.0, < 15.2.3, >= 12.0.0, < 12.3.5 | 13.5.9, 14.2.25, 15.2.3, 12.3.5 |
References
- https://github.com/vercel/next.js/security/advisories/GHSA-f82v-jwr5-mffw
- https://nvd.nist.gov/vuln/detail/CVE-2025-29927
- https://github.com/vercel/next.js/commit/52a078da3884efe6501613c7834a3d02a91676d2
- https://github.com/vercel/next.js/commit/5fd3ae8f8542677c6294f32d18022731eab6fe48
- https://github.com/vercel/next.js
- https://github.com/vercel/next.js/releases/tag/v12.3.5
- https://github.com/vercel/next.js/releases/tag/v13.5.9
- https://security.netapp.com/advisory/ntap-20250328-0002
- https://vercel.com/changelog/vercel-firewall-proactively-protects-against-vulnerability-with-middleware
- http://www.openwall.com/lists/oss-security/2025/03/23/3
- http://www.openwall.com/lists/oss-security/2025/03/23/4
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N- Weakness (CWE)
CWE-285, CWE-863- Platform
- npm
- Package
next- Disclosed
- 21.03.2025
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-f82v-jwr5-mffw - CC BY 4.0
Vulnerability history: next
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 73
- First → latest
- 12.2017 10.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Critical 5
- High 27
- Medium 32
- Low 9
Disclosures per year
- 2017: 1
- 2018: 2
- 2019: 0
- 2020: 3
- 2021: 3
- 2022: 3
- 2023: 1
- 2024: 6
- 2025: 14
- 2026: 40
-
Authorization Bypass in Next.js Middleware this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.