Ghost-Route – Ghost Route Detects If A Next JS Site Is Vulnerable To The Corrupt Middleware Bypass Bug (CVE-2025-29927)

Vulnerability Details

Basic Information

Title Ghost-Route – Ghost Route Detects If A Next JS Site Is Vulnerable To The Corrupt Middleware Bypass Bug (CVE-2025-29927)
Type kitploit
Published 2025-04-22T12:30:00
Last Seen 2025-04-22T13:53:03
CVSS Score 9.1 (CRITICAL)

CVSS v3 Details

Attack Vector NETWORK
Attack Complexity LOW
Privileges Required NONE
User Interaction NONE
Scope UNCHANGED
Confidentiality Impact HIGH
Integrity Impact HIGH
Availability Impact NONE

CVE Information

CVE IDs CVE-2025-29927
CWE
Bulletin Family tools

Description

![](https://blogger.googleusercontent.com/img/a/AVvXsEilKvkxEHc-ev4Xsq_VY3ESgilrPqF1W1R_jweMVYs1iDsv6iox3-VhaMXUkL0GPAMhHxG2UAVEOD-wyhIBdXt8V2uLoN4vBKQuwDzzeDoFBLg61jLgz_1jwbXA1oOO7uRr0q1i3CKhn58GZdlHCUzT2HH6SNWbgmAtoAULvmfuDwPxIUm_SY5iNCrvAdc=w640-h254)

A Python script to check Next.js sites for corrupt middleware vulnerability (CVE-2025-29927).

The corrupt middleware vulnerability allows an attacker to bypass authentication and access protected routes by send a custom header `x-middleware-subrequest`.

Next JS versions affected: – 11.1.4 and up

> [!WARNING] This tool is for educational purposes only. Do not use it on websites or systems you do not own or have explicit permission to test. Unauthorized testing may be illegal and unethical.

## Installation

Clone the repo

git clone https://github.com/takumade/ghost-route.git
cd ghost-route

Create and activate virtual environment

python -m venv .venv
source .venv/bin/activate

Install dependencies

pip install -r requirements.txt

## Usage

python ghost-route.py

* ``: Base URL of the Next.js site (e.g., https://example.com)
* ``: Protected path to test (default: /admin)
* ``: Show response headers (default: False)

## Example

Basic Example

python ghost-route.py https://example.com /admin

Show Response Headers

python ghost-route.py https://example.com /admin True

## License

MIT License

## Credits

* CVE-2025-29927
* Next.js and the corrupt middleware: the authorizing artifact
* Rachid A.
* Yasser Allam

**Download Ghost-Route**

Impact Assessment

Base Score 9.1
Severity CRITICAL

💭 Join the Security Discussion

🔒 Your email address will not be published. Required fields are marked *

⚠️ Please be respectful and constructive in your comments. Security discussions should remain professional.