CVE-2025-29927: 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.
Published Mar 21, 2025 · Updated Mar 2, 2026
Affected packages
next
- Ecosystem
- npm
- Affected
- >= 13.0.0, < 13.5.9
- Fixed in
- 13.5.9
- Check
npm ls next
next
- Ecosystem
- npm
- Affected
- >= 14.0.0, < 14.2.25
- Fixed in
- 14.2.25
- Check
npm ls next
next
- Ecosystem
- npm
- Affected
- >= 15.0.0, < 15.2.3
- Fixed in
- 15.2.3
- Check
npm ls next
next
- Ecosystem
- npm
- Affected
- >= 12.0.0, < 12.3.5
- Fixed in
- 12.3.5
- Check
npm ls next
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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_)
Credited to cold-try, Wenxin-Jiang.
References
- https://github.com/vercel/next.js/security/advisories/GHSA-f82v-jwr5-mffw
- https://github.com/vercel/next.js/commit/52a078da3884efe6501613c7834a3d02a91676d2
- https://github.com/vercel/next.js/commit/5fd3ae8f8542677c6294f32d18022731eab6fe48
- https://nvd.nist.gov/vuln/detail/CVE-2025-29927
- https://github.com/vercel/next.js/releases/tag/v12.3.5
- https://github.com/vercel/next.js/releases/tag/v13.5.9
- https://vercel.com/changelog/vercel-firewall-proactively-protects-against-vulnerability-with-middleware
- https://security.netapp.com/advisory/ntap-20250328-0002
- https://github.com/advisories/GHSA-f82v-jwr5-mffw
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesGHSA-2464-fhr4-w9xw
Next.js: Unauthenticated Remote Code Execution in Image Optimization API when SVG files are used
critical9.5Oct 22, 2026GHSA-673q-mjm6-r5xr
Next.js: Unauthenticated Remote Code Execution in `use cache` functions returning typed arrays
critical9.5Oct 22, 2026CVE-2026-94486
Next.js has information disclosure in development server's Model Context Protocol endpoint
low5.4Oct 7, 2026GHSA-vcvr-r3jv-pc5j
Next.js: Remote Code Execution in next/og ImageResponse
critical9.5Sep 30, 2026CVE-2026-75604
Next.js: Unauthenticated Remote Code Execution on windows-hosted servers
critical9.0Sep 8, 2026GHSA-2xp9-vwfh-vxw4
Next.js: Unauthenticated Remote Code Execution in Image Optimization API when AVIF files are used
critical9.5Sep 8, 2026
