What’s Vulnerable › Vulnerabilities

CVE-2025-57822: Next.js Improper Middleware Redirect Handling Leads to SSRF

Description

Next.js is a React framework for building full-stack web applications. Prior to versions 14.2.32 and 15.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. This vulnerability has been fixed in Next.js versions 14.2.32 and 15.4.7. All users implementing custom middleware logic in self-hosted environments are strongly encouraged to upgrade and verify correct usage of the next() function.

Affected products

How to fix

Upgrade to a fixed version: Next.js 14.2.32, 15.4.7; Npm Next 14.2.32, 15.4.7. Check the vendor advisory for mitigations.

References

Get alerted when CVE-2025-57822 or the next vulnerability affects your stack