Critical Next.js Web Vulnerability Allows Attackers to Bypass Protections
EC
A serious security flaw has been discovered in Next.js, one of the most popular frameworks for building modern websites and web applications. This vulnerability, officially designated CVE-2025-29927, allows attackers to bypass important security checks, potentially granting unauthorized access to sensitive areas of a website.
If your website or application is built with Next.js, it is essential to update immediately to mitigate the risk.
What Is Next.js and Why Does This Matter?
For those unfamiliar, Next.js is a framework used by developers to build high-performance websites and applications. It is widely adopted due to its ability to improve development speed, efficiency, and scalability. Many well-known companies rely on Next.js to power their digital platforms.
A security vulnerability in a widely used framework like this is significant because it could affect thousands of websites, potentially exposing user data, sensitive business information, and administrative controls to attackers.
Understanding the Vulnerability
The issue stems from a special internal security mechanism that Next.js uses to manage how requests are processed in an application. This mechanism relies on the x-middleware-subrequest header to ensure that certain system processes function correctly.
By manipulating this header, an attacker can trick Next.js into skipping critical security checks. This could allow unauthorized access to areas of a website that should be protected, including admin panels, user accounts, and restricted content.
In simpler terms, this vulnerability is comparable to a faulty security gate. If someone discovers how to bypass it, they can gain access to areas that are supposed to be restricted—without triggering any alarms.

Who Is Affected?
Not every Next.js website is vulnerable, but many are. The issue specifically affects websites that are self-hosted, use the next start command for deployment, and are deployed using the ‘standalone’ output option, which is common in production environments.
However, websites hosted on platforms such as Vercel or Netlify are not affected because these providers implement their own security measures.
Severity of the Threat
Security experts have assigned this vulnerability a CVSS score of 9.1 out of 10, categorizing it as critical. This rating indicates that attackers could actively exploit this issue to bypass authentication systems and other protective measures, potentially leading to data theft, account takeovers, or even full website compromise.
Recommended Actions
If your website or application uses Next.js, it is crucial to update to a secure version as soon as possible. The following Next.js versions contain the necessary security patch:
- 12.3.5
- 13.5.9
- 14.2.25
- 15.2.3
For organizations that cannot update immediately, a temporary workaround involves configuring the web server or reverse proxy (such as Nginx, Apache, or Cloudflare) to block external requests containing the x-middleware-subrequest header. This measure can prevent attackers from exploiting the vulnerability while an update is being planned.

How This Was Discovered
This vulnerability was first reported on February 27, 2025, by a security researcher. The response from the Next.js team was swift, with a structured rollout of security patches.
Timeline of Events
- February 27, 2025 – Vulnerability reported to the Next.js security team.
- March 14, 2025 – The issue was confirmed, and patch development began.
- March 18, 2025 – The first set of security updates was released.
- March 21, 2025 – A public security advisory was issued to notify developers.
- March 22-23, 2025 – Additional updates were provided for older versions of Next.js.
The quick response from the Next.js team has helped mitigate widespread exploitation, but any website that has not yet updated remains at risk.
Conclusion
This incident serves as an important reminder of the need for regular software updates and proactive security practices. Cybercriminals continually seek out vulnerabilities, and even widely trusted frameworks like Next.js can be exposed to security risks.
For organizations using Next.js, the recommended course of action is clear: update to the latest patched version immediately, work with your development team to review security settings and configurations, and monitor for any unusual activity to detect potential unauthorized access attempts.
If you and your buisness would like to prevent attacks like these before they happen, vist our "Contact Us page". With our vCISO service we can provide you with continuous network monitoring to mitigate threats. Taking these steps will help safeguard your website, protect user data, and maintain trust in your platform.