Category
Vulnerability Management
Topic
CVE-2025-29927: Critical security vulnerability in Next.js
Audience
Developers and operators of Next.js applications
Reading time
approx. 5 minutes

Next.js is an open-source web development framework from Vercel that provides React-based web applications with server-side and static rendering. In March 2025, details of a security vulnerability designated CVE-2025-29927 were published.

Background and exploitation of the security vulnerability

On 22 March 2025, Next.js announced a security vulnerability in the middleware layer that allowed authentication to be bypassed. Exploitation is trivial and can be achieved by sending an additional HTTP header with the content x-middleware-subrequest: true .

Severity and consequences of the security vulnerability

The CVE-2025-29927 security vulnerability is rated 9.1 according to the CVSSv3 Base Score. Successful exploitation of this vulnerability would allow a remote attacker to bypass the security checks implemented in the middleware layer, including many forms of authentication. This ultimately exposes application endpoints that would otherwise be protected.

Affected versions and security controls

Patches are available:

  • Next.js 15.x: The issue was fixed in version 15.2.3.

  • Next.js 14.x: The issue was fixed in version 14.2.25.

  • Next.js 11.1.4 to 13.5.6: For these versions, it is recommended to use a workaround, as no direct patch is available.

Next.js deployments hosted on Vercel are automatically protected against this security vulnerability. If it is not possible to patch to a secure version, it is recommended to prevent external user requests containing the header x-middleware-subrequest from reaching the Next.js application.

Scope of the vulnerability

According to Shodan, over 300,000 systems worldwide can be found with the header “X-Powered-By: Next.js”. In Germany, the service reports that over 33,000 systems are accessible. It is important to note that these are only the systems that are identifiable from the outside and publicly accessible; the number of affected systems that remain undiscovered is likely to be higher.

Shodan Suchergebnis zu Next.js
Shodan search results for Next.js

Over the past nine years, Next.js has published a total of 16 security advisories. The security vulnerability described here (CVE-2025-29927) is the first of these to be classified as critical. There is an urgent need for action; the security vulnerability should be patched as soon as possible. The researchers who discovered the security vulnerability explain in a detailed blog post how they found it.

“A single HTTP header is enough to bypass authentication checks, which shows just how critical properly implemented middleware is for application security.” Mint Secure GmbH

How Mint Secure can help you

Critical framework vulnerabilities such as CVE-2025-29927 require swift and informed action; we are here to support you.

🚨

Incident Response

Rapid response and prioritisation when critical CVEs such as these are identified in your infrastructure.

🛡️

Penetration Testing

Assessment of your web applications for known and unknown vulnerabilities in the framework and middleware.

🔎

Vulnerability Management

Continuous monitoring of relevant CVEs and advisories so that you can apply patches in good time.

Do you run Next.js applications and are unsure whether you’re affected? We’ll check your systems. Get in touch now.

Conclusion

CVE-2025-29927 is a critical security vulnerability, rated 9.1 on the CVSS scale, in the middleware layer of Next.js. A single manipulated HTTP header is enough to bypass authentication checks and expose application areas that are normally protected. Operators of affected versions should apply the patch immediately or, if that is not possible, filter out the header on the server side. Do you need help securing your Next.js applications? Get in touch with us.