Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2025-29927 PoC — Authorization Bypass in Next.js Middleware

Source
Associated Vulnerability
Title:Authorization Bypass in Next.js Middleware (CVE-2025-29927)
Description:Next.js is a React framework for building full-stack web applications. Starting in version 1.11.4 and prior to versions 12.3.5, 13.5.9, 14.2.25, and 15.2.3, it is possible to bypass authorization checks within a Next.js application, if the authorization check occurs in middleware. If patching to a safe version is infeasible, it is recommend that you prevent external user requests which contain the x-middleware-subrequest header from reaching your Next.js application. This vulnerability is fixed in 12.3.5, 13.5.9, 14.2.25, and 15.2.3.
Description
Next.js Auth Bypass PoC Edge Runtime Env Leak via Middleware Bug
Readme
# CVE-2025-29927 - Next.js Auth Bypass PoC

Este es un **Proof of Concept (PoC)** en Python para detectar la vulnerabilidad crítica **CVE-2025-29927** que afecta a aplicaciones desarrolladas con **Next.js**, específicamente cuando utilizan **middleware para la autorización**.

> 📌 La vulnerabilidad permite eludir completamente la autenticación, accediendo a rutas protegidas si el middleware está mal implementado.

---

## 🧠 Descripción

**CVE-2025-29927** permite a atacantes omitir el middleware de autenticación de Next.js cuando ciertas rutas o configuraciones se ven comprometidas. Esto se debe a un comportamiento inesperado en el runtime de Edge combinado con rutas protegidas por middleware.

Este PoC verifica si el servidor usa Next.js con middleware y podría ser susceptible a esta falla, basándose en los headers HTTP devueltos.

---

## 🚀 Uso

### Requisitos

- Python 3.x
- Módulo `requests`  
  Instálalo con:  
  ```bash
  pip install requests
File Snapshot

[4.0K] /data/pocs/2f7de1100350fb44cc71b326099be2fb8ecedd11 ├── [1.7K] main.py ├── [ 983] README.md └── [ 8] requirements.txt 1 directory, 3 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →