Advisory

GHSA-4342-x723-ch2f

Also known as: CVE-2025-57822

Summary

Next.js Improper Middleware Redirect Handling Leads to SSRF

Details

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

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2025-08-29 21:33 UTC
Modified
2026-09-10 03:50 UTC

Affected packages and fixes

next

npm · All systems

Affected

  • introduced 0.9.9, fixed 14.2.32 (semver)

Fixed versions

14.2.32

Fix

next

npm · All systems

Affected

  • introduced 15.0.0-canary.0, fixed 15.4.7 (semver)

Fixed versions

15.4.7

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences