CVE-2025-29927
JSON

9.1critical

Authorization Bypass in Next.js Middleware

Severity
9.1critical CVSS:3.1 by GitHub_M
Exploit likelihood
99.2% (higher than 99% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-f82v-jwr5-mffw

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.

Affected

Product or packageVersionsReported by
vercel next.js>= 11.1.4, < 12.3.5, >= 14.0.0, < 14.2.25, >= 15.0.0, < 15.2.3, >= 13.0.0, < 13.5.9, from 11.1.4 before 12.3.5, from 13.0.0 before 13.5.9, from 14.0.0 before 14.2.25, from 15.0.0 before 15.2.3CVE List, NVD
next (npm)from 13.0.0 before 13.5.9, from 14.0.0 before 14.2.25, from 15.0.0 before 15.2.3, from 12.0.0 before 12.3.5GitHub Advisory Database

All scores

GitHub_M9.1critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
GitHub9.1critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Classification

CWE-285CWE-863

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total.

What each source says

CVE List

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.

GitHub Advisory Database

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_)
NVD (es)

Next.js es un framework de React para crear aplicaciones web full-stack. En versiones anteriores a la 14.2.25 y la 15.2.3, era posible omitir las comprobaciones de autorización dentro de una aplicación Next.js si esta se realizaba en middleware. Si no es posible aplicar una versión segura, se recomienda evitar que las solicitudes de usuarios externos que contengan el encabezado "x-middleware-subrequest" lleguen a la aplicación Next.js. Esta vulnerabilidad se corrigió en las versiones 14.2.25 y 15.2.3.

References

https://github.com/vercel/next.js/security/advisories/GHSA-f82v-jwr5-mffwvendor-advisory, web
https://github.com/vercel/next.js/commit/52a078da3884efe6501613c7834a3d02a91676d2patch, web
https://github.com/vercel/next.js/commit/5fd3ae8f8542677c6294f32d18022731eab6fe48patch, web
https://github.com/vercel/next.js/releases/tag/v12.3.5release-notes, web
https://github.com/vercel/next.js/releases/tag/v13.5.9release-notes, web
http://www.openwall.com/lists/oss-security/2025/03/23/3mailing-list, third-party-advisory, web
http://www.openwall.com/lists/oss-security/2025/03/23/4mailing-list, web
https://security.netapp.com/advisory/ntap-20250328-0002/third-party-advisory
https://nvd.nist.gov/vuln/detail/CVE-2025-29927advisory
https://github.com/vercel/next.jspackage
https://security.netapp.com/advisory/ntap-20250328-0002web
https://vercel.com/changelog/vercel-firewall-proactively-protects-against-vulnerability-with-middlewareweb

Sources

SourceRecordLicence
CVE ListCVE-2025-29927 changed 2025-04-08CVE Terms of Use
GitHub Advisory DatabaseGHSA-f82v-jwr5-mffw changed 2026-09-10CC-BY-4.0
NVDCVE-2025-29927 changed 2026-06-17Public domain