Article Details
Scrape Timestamp (UTC): 2025-03-24 09:22:22.998
Source: https://thehackernews.com/2025/03/critical-nextjs-vulnerability-allows.html
Original Article Text
Click to Toggle View
Critical Next.js Vulnerability Allows Attackers to Bypass Middleware Authorization Checks. A critical security flaw has been disclosed in the Next.js React framework that could be potentially exploited to bypass authorization checks under certain conditions. The vulnerability, tracked as CVE-2025-29927, carries a CVSS score of 9.1 out of 10.0. "Next.js uses an internal header x-middleware-subrequest to prevent recursive requests from triggering infinite loops," Next.js said in an advisory. "It was possible to skip running middleware, which could allow requests to skip critical checks—such as authorization cookie validation—before reaching routes." The shortcoming has been addressed in versions 12.3.5, 13.5.9, 14.2.25, and 15.2.3. If patching is not an option, it's recommended that users prevent external user requests that contain the x-middleware-subrequest header from reaching the Next.js application. Security researcher Rachid Allam (aka zhero and cold-try), who is credited with discovering and reporting the flaw, has since published additional technical details of the flaw, making it imperative that users move quickly to apply the fixes. "The vulnerability allows attackers to easily bypass authorization checks performed in Next.js middleware, potentially allowing attackers access to sensitive web pages reserved for admins or other high-privileged users," JFrog said. The company also said any host website that utilizes middleware to authorize users without any additional authorization checks is vulnerable to CVE-2025-29927, potentially enabling attackers to access otherwise unauthorized resources (e.g., admin pages).
Daily Brief Summary
A critical security vulnerability, CVE-2025-29927, has been identified in Next.js, affecting middleware authorization checks.
The vulnerability has a high severity with a CVSS score of 9.1, indicating significant risk potential.
Attackers could exploit this flaw to skip middleware and access restricted areas of the web application, such as admin pages.
Next.js versions impacted include 12.3.5, 13.5.9, 14.2.25, and 15.2.3; patches are available to address this issue.
If unable to patch promptly, users should block requests containing the "x-middleware-subrequest" header, which is exploited in attacks.
Researcher Rachid Allam (aka zhero or cold-try) discovered and reported the flaw, and has since published technical details, heightening the urgency for patches.
Websites relying solely on middleware for user authorization and not employing secondary checks are particularly vulnerable.