CVE-2025-57822 Next.js Improper Middleware Redirect Handling Leads to SSRF
HighCVSS 8.2
EPSS 2.3%
Scanner template
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · automatable: no · technical impact: partial
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.
Upgrade path
2 packages: 2 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| npm next(npm) | >= 0.9.9, < 14.2.32; >= 15.0.0-canary.0, < 15.4.7 | 14.2.32, 15.4.7 | Fixed |
| vercel next.js | < 14.2.32; = < 14.2.32; = < 15.4.7; >= 15.0.0, < 15.4.7 | 14.2.32, 15.4.7 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| npm next(npm) | >= 15.0.0-canary.0, < 15.4.7 | 15.4.7 |
| npm next(npm) | >= 0.9.9, < 14.2.32 | 14.2.32 |
| vercel next.js | = < 14.2.32 | No fix listed |
| vercel next.js | = < 15.4.7 | No fix listed |
| vercel next.js | < 14.2.32 | 14.2.32 |
| vercel next.js | >= 15.0.0, < 15.4.7 | 15.4.7 |
References
- https://github.com/vercel/next.js/security/advisories/GHSA-4342-x723-ch2f vendor-advisory
- https://github.com/vercel/next.js/commit/9c9aaed5bb9338ef31b0517ccf0ab4414f2093d8 patch
- https://vercel.com/changelog/cve-2025-57822 mitigation vendor-advisory
- nvd.nist.gov third-party-advisory vendor-advisory
- github.com
- github.com product