CVE-2025-57822: Next.js Improper Middleware Redirect Handling Leads to SSRF
A vulnerability in Next.js Middleware has been fixed in v14.2.32 and v15.4.7. When next()
was used without explicitly passing the request
object, it could lead to SSRF in self-hosted applications that incorrectly forwarded user-supplied headers.
All users implementing custom middleware logic in self-hosted environments are strongly encouraged to upgrade and verify correct usage of the next()
function.
More details at Vercel Changelog
References
Code Behaviors & Features
Detect and mitigate CVE-2025-57822 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →