GitHub Advisoryadvisory · npm

GHSA-4342-x723-ch2f Next.js Improper Middleware Redirect Handling Leads to SSRF

MEDIUM Published 2025-08-29 Modified 2025-09-11 Official page ↗
Aliases
CVE-2025-57822
Ecosystem
npm
Packages
next
Severity
Moderate
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N
Weaknesses
CWE-918
Reviewed
2025-08-29

Affected packages

• npm next: >= 0.9.9, < 14.2.32 → fixed in 14.2.32 • npm next: >= 15.0.0-canary.0, < 15.4.7 → fixed in 15.4.7

Description

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

Related

Alias · CVE (1)

  • CVE-2025-57822 Next.js is a React framework for building full-stack web applications. vulnerability

Weakness · CWE (1)

  • CWE-918 Server-Side Request Forgery weakness

References