Vulnerability · Published Aug 29, 2025 · Assigned by GitHub_M
CVE-2025-57822Next.js Improper Middleware Redirect Handling Leads to SSRF
Medium 6.5
In plain English
A medium-severity server-side request forgery in next.js from vercel. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 2.6% (higher than 85% of all known vulnerabilities). Ready-made attack tooling exists: Nuclei. Fixed versions are available - upgrade the affected package.
Official 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 packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| npm | next | 14.2.32 | GHSA-4342-x723-ch2f |
| npm | next | 15.4.7 | GHSA-4342-x723-ch2f |
Affected products (as reported)
Weakness: CWE-918 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N
References
- https://github.com/vercel/next.js/security/advisories/GHSA-4342-x723-ch2f x_refsource_CONFIRM
- https://github.com/vercel/next.js/commit/9c9aaed5bb9338ef31b0517ccf0ab4414f2093d8 x_refsource_MISC
- https://vercel.com/changelog/cve-2025-57822 x_refsource_MISC