
Next.js Middleware Bypass (CVE-2025-29927) Proof of Concept This repository contains a proof of concept (POC) for CVE-2025-29927, a critical vulnerability in Next.js that allows attackers to bypass authorization checks implemented in middleware. đź“‹ Table of Contents Running the POC Application Using the Exploit Script How to Fix the Vulnerability Vulnerability Details Running the POC Application This Next.js application demonstrates the vulnerability with a protected dashboard route. Setup Instructions Clone the repository Install and run: bash npm install npm run build npm run start Access https://localhost:3000 in your browser Try accessing the protected dashboard at /dashboard Using the Exploit Script The exploit script can test any Next.js application for this vulnerability. Usage bash npm run exploit <target-url> Example bash npm run exploit https://localhost:3000/dashboard How it Works The exploit tool: 1. Takes a target URL as input 2. Makes a normal request to check if the route is protected 3. Attempts to bypass middleware using the x-middleware-subrequest header 4. Compares responses to determine vulnerability Sample Output “`bash === Next.js CVE-2025-29927 Middleware Bypass Tester === Target: https://localhost:3000/dashboard Testing vulnerability… Normal request status: 307 Bypass request status: 200 ⚠️ VULNERABLE The route is protected but accessible with the bypass header “` How to Fix the Vulnerability A fix implementation is available…Read More
References
Back to Main