Skip to content

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.

PackageAffectedFixed inStatus
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

ProductAffected versionsFixed 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