CVE-2025-29927 Authorization Bypass in Next.js Middleware

Critical 9.1 Published Updated

Attackers can bypass authorization checks in Next.js middleware by sending a specific header, allowing unauthorized access to protected resources.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-29927?

CVE-2025-29927 is a critical authentication bypass vulnerability in Vercel Next.js, published on 21 Mar 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-863, CWE-285

Which versions are affected by CVE-2025-29927?

8 open source packages ship an affected version, including next. It affects 1 product.

PackageAffectedFixed in
next npmFrom 12.0.012.3.5
next npmFrom 12.0.012.3.5
next npmFrom 13.0.013.5.9
next npmFrom 13.0.013.5.9
next npmFrom 14.0.014.2.25
next npmFrom 14.0.014.2.25
2 more packages
next npmFrom 15.0.015.2.3
next npmFrom 15.0.015.2.3

Products include Vercel Next.js.

How do I fix CVE-2025-29927?

Upgrade next to a fixed version for your release line: 12.3.5, 13.5.9, 14.2.25 or 15.2.3.

Upgrade, and rotate credentials and sessions that may have been exposed. More about Authentication bypass.

Is CVE-2025-29927 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-29927 exists.

Public exploit code: 1 Metasploit module, 1 Exploit-DB entry, 1 Nuclei template and 127 proofs of concept on GitHub.

All Vercel Next.js vulnerabilities

Sources

Also known as GHSA-f82v-jwr5-mffw, MINI-fwhh-grf5-h64v, ROOT-APP-NPM-CVE-2025-29927.

Is CVE-2025-29927 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free