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

Published Aug 29, 2025
·
Updated

A vulnerability in Next.js Middleware has been fixed in v14.2.32 and v15.4.7. The issue occurred when request headers were directly passed into NextResponse.next(). In self-hosted applications, this could allow Server-Side Request Forgery (SSRF) if certain sensitive headers from the incoming request were reflected back into the response.

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

Other sources

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.

NVD

Affected Software

6 affected componentsFixes available
Vercel Next.js<14.2.32, <17.4.7
npm/next>=15.0.0-canary.0<15.4.7
15.4.7
npm/next<14.2.32
14.2.32
Vercel Next.js Node.js<14.2.32
Vercel Next.js Node.js>=15.0.0<15.4.7
npm/next>=0.9.9<14.2.32
14.2.32

Event History

Aug 29, 2025
Advisory Published
via GitHub·09:33 PM
Data Sourced
via GitHub·09:33 PM
DescriptionSeverityWeaknessAffected Software
CVE Published
via MITRE·09:33 PM
Data Sourced
via MITRE·09:33 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-57822?

CVE-2025-57822 has been classified as a critical vulnerability due to potential SSRF risks in self-hosted environments.

2

How do I fix CVE-2025-57822?

To mitigate CVE-2025-57822, upgrade to Next.js versions 14.2.32 or 15.4.7 as recommended.

3

What applications are affected by CVE-2025-57822?

CVE-2025-57822 affects self-hosted Next.js applications that improperly handle user-supplied headers.

4

What is the nature of the vulnerability in CVE-2025-57822?

CVE-2025-57822 involves Server-Side Request Forgery (SSRF) due to incorrect usage of the `next()` function.

5

Who is the vendor for CVE-2025-57822?

The vendor for CVE-2025-57822 is Vercel, the creator of Next.js.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203