Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2025-29927-NextJs-Middleware-Simulation — Simulates CVE-2025-29927, a critical Next.js vulnerability allowing attackers to bypass middleware authorization by exploiting the internal x-middleware-subrequest HTTP header. Demonstrates unauthorized access to protected routes and provides mitigation strategies. | Kitploit
Tools/GitHubGitHub/knotsecurity/cve-2025-29927-nextjs-middleware-simulation
Vulnerability AnalysisWeb Application ExploitationWeb SecurityPenetration TestingMisconfigurationLearning & Education
GitHubknotsecurity/cve-2025-29927-nextjs-middleware-simulation

CVE-2025-29927-NextJs-Middleware-Simulation

Simulates CVE-2025-29927, a critical Next.js vulnerability allowing attackers to bypass middleware authorization by exploiting the internal x-middleware-subrequest HTTP header. Demonstrates unauthorized access to protected routes and provides mitigation strategies.

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share
View Repository
1 year agoNot yet reviewed

CVE-2025-29927: Next.js Middleware Authorization Bypass Simulation

This repository demonstrates the exploitation of CVE-2025-29927, a critical vulnerability in Next.js that allows attackers to bypass middleware-based authorization checks. The flaw stems from improper handling of the internal x-middleware-subrequest HTTP header, enabling unauthorized access to protected routes.

⚠️ Disclaimer

This project is intended for educational and research purposes only. Unauthorized use against systems without explicit permission is illegal and unethical. The authors are not responsible for any misuse of this code.

📚 Background

CVE-2025-29927 affects Next.js versions prior to:

  • 12.3.5
  • 13.5.9
  • 14.2.25
  • 15.2.3

The vulnerability arises when an attacker includes the x-middleware-subrequest header in an HTTP request. Next.js interprets this header as an internal subrequest, causing it to skip middleware execution, including critical authorization checks.

🧪 Simulation Setup

Prerequisites

  • Node.js (v14 or later)
  • npm

Installation

  1. Clone the repository:
    root@kitploit:~
    git clone https://github.com/Knotsecurity/CVE-2025-29927-NextJs-Middleware-Simulation.git
    cd cve-2025-29927-simulation
  2. Install dependencies:
    root@kitploit:~
    npm install
  3. Start the development server:
    root@kitploit:~
    npm run dev
    

🔍 Vulnerability Demonstration

Protected Route

The application includes a protected route at /admin, which is guarded by middleware that checks for user authentication.

Exploitation Steps

  1. Access the /login page and log in with [email protected]:password123.
  2. Try to access the /admin page. You will get an unauthorized access error.
  3. Capture this request in Burp Suite and add the header x-middleware-subrequest: middleware, then send the request.
  4. You will observe that you now have access to the /admin page.

🛡️ Mitigation

To protect against this vulnerability:

  1. Upgrade Next.js to a patched version:
    root@kitploit:~
    npm install next@latest
  2. Filter Requests: Configure your server or proxy to reject requests containing the x-middleware-subrequest header.
  3. Redundant Checks: Implement authorization checks within your route handlers, not solely in middleware.

📄 References

  • Next.js Security Advisory
  • Akamai Blog on CVE-2025-29927
  • Datadog Analysis

🧑‍💻 Author

Saikiran B

Download Tool