Thursday, March 6, 2025
HomeCVE/vulnerabilityNext.js Vulnerability Let Attackers Bypass Authentication

Next.js Vulnerability Let Attackers Bypass Authentication

Published on

SIEM as a Service

Follow Us on Google News

A high-severity vulnerability has been discovered in the popular web framework, Next.js, which allows attackers to bypass authentication under specific circumstances.

The issue, cataloged as CVE-2024-51479, affects versions from 9.5.5 up to 14.2.14. Developers using these versions must quickly upgrade to the patched version 14.2.15 to secure their applications.

Authorization Bypass in Next.js ( CVE-2024-51479)

The vulnerability stems from a flaw in how Next.js handles authorization checks in middleware based on pathname rules.

If an application relies on pathname-based middleware to enforce access control, it may inadvertently expose certain routes to unauthorized access.

Free Webinar on Best Practices for API vulnerability & Penetration Testing:  Free Registration

Specifically, routes directly under the application’s root directory are vulnerable to bypass.

For instance, while the root path such as https://example.com/ remains unaffected, a route like https://example.com/foo could be exploited, whereas deeper nested routes like https://example.com/foo/bar are not impacted.

This vulnerability poses a significant risk for applications that manage sensitive data or services on affected routes.

Exploitation does not require user interaction, credentials, or elevated privileges, making it an attractive target for attackers operating over a network.

The vulnerability is rated as high severity, with a CVSS v3 score of 7.5. Exploiting the vulnerability compromises confidentiality, with unauthorized access to data being the primary concern.

However, it does not affect the integrity or availability of the application. The attack complexity is low, further amplifying the risk, as it requires no special privileges or user interaction to execute.

Patches and Mitigation

The Next.js team has addressed the issue in version 14.2.15. Updating to this version eliminates the vulnerability by ensuring proper authorization checks for all routes, including those directly under the root directory.

For applications hosted on Vercel, this vulnerability has already been mitigated automatically, irrespective of the Next.js version being used.

However, developers running self-hosted or custom deployments should urgently update their projects to the patched version to prevent exploitation.

No official workarounds are available for this vulnerability. The most effective action is to immediately update to Next.js version 14.2.15 or later.

Developers are also encouraged to review their middleware and route protection strategies to ensure robust security measures are in place.

Security audits and monitoring of access logs can help detect any unauthorized activity, particularly for routes that may have been previously exposed.

The vulnerability was responsibly disclosed by tyage, a security researcher from GMO CyberSecurity by IERAE. The Next.js team has expressed its gratitude for the timely and responsible reporting of this issue.

Further details are available in the official advisories published by the Next.js team, highlighting their commitment to maintaining a secure development environment.

Investigate Real-World Malicious Links, Malware & Phishing Attacks With ANY.RUN – Try for Free

Divya
Divya
Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Latest articles

Implementing Identity First Security for Zero Trust Architectures

Zero Trust is a security framework that operates under the assumption that no implicit...

InvokeADCheck – New Powershell Module for Active Directory Assessment

Orange Cyberdefense has announced the development of InvokeADCheck, a new PowerShell module designed to...

Detecting Malicious Activities With Traffic Distribution Systems

Traffic Distribution Systems (TDS) have emerged as critical tools for both legitimate and malicious...

Hackers Deploy Advanced Social Engineering Tactics in Phishing Attacks

Cybercriminals are evolving their phishing methods, employing more sophisticated social engineering tactics to deceive...

Supply Chain Attack Prevention

Free Webinar - Supply Chain Attack Prevention

Recent attacks like Polyfill[.]io show how compromised third-party components become backdoors for hackers. PCI DSS 4.0’s Requirement 6.4.3 mandates stricter browser script controls, while Requirement 12.8 focuses on securing third-party providers.

Join Vivekanand Gopalan (VP of Products – Indusface) and Phani Deepak Akella (VP of Marketing – Indusface) as they break down these compliance requirements and share strategies to protect your applications from supply chain attacks.

Discussion points

Meeting PCI DSS 4.0 mandates.
Blocking malicious components and unauthorized JavaScript execution.
PIdentifying attack surfaces from third-party dependencies.
Preventing man-in-the-browser attacks with proactive monitoring.

More like this

Implementing Identity First Security for Zero Trust Architectures

Zero Trust is a security framework that operates under the assumption that no implicit...

InvokeADCheck – New Powershell Module for Active Directory Assessment

Orange Cyberdefense has announced the development of InvokeADCheck, a new PowerShell module designed to...

Detecting Malicious Activities With Traffic Distribution Systems

Traffic Distribution Systems (TDS) have emerged as critical tools for both legitimate and malicious...