NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

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

mediumCVSS 3.1 6.5GHSA-4342-x723-ch2f

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.

Published Aug 29, 2025 · Updated Sep 11, 2025

Affected packages

next

Ecosystem
npm
Affected
>= 15.0.0-canary.0, < 15.4.7
Fixed in
15.4.7
Check
npm ls next

next

Ecosystem
npm
Affected
>= 0.9.9, < 14.2.32
Fixed in
14.2.32
Check
npm ls next

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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

Credited to medikoo, prdngr.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More npm vulnerabilities

All npm entries