Description
A vulnerability in Next.js allows attackers to bypass middleware-based authorization checks by adding a specially crafted x-middleware-subrequest header to HTTP requests. This bypass completely circumvents middleware controls that are commonly used for implementing authorization, path rewriting, server-side redirects, and adding response headers such as Content Security Policy (CSP).
Remediation
Update to the latest patched version of Next.js (13.5.7+, 14.2.25+, or 15.2.3+). If immediate updating is not possible, implement additional layers of access control that don't rely solely on Next.js middleware, such as server-side validation of authentication tokens or implementing access controls at the API or database level.
References
Authorization Bypass in Next.js Middleware
Next.js and the corrupt middleware: the authorizing artifact
Related Vulnerabilities
WordPress Plugin Countdown Block Security Bypass (1.1.1)
WordPress Plugin Minimal Coming Soon & Maintenance Mode-Coming Soon Page Security Bypass (2.15)
WordPress Plugin Spotlight Social Feeds [Block, Shortcode, and Widget] Security Bypass (0.10.1)
WordPress Plugin Elementor Website Builder Security Bypass (2.9.5)
WordPress Plugin Total Donations for Wordpress Security Bypass (2.0.5)