Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. next
  4. ›
  5. CVE-2025-57822

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

August 29, 2025 (updated September 11, 2025)

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

References

  • github.com/advisories/GHSA-4342-x723-ch2f
  • github.com/vercel/next.js
  • github.com/vercel/next.js/commit/9c9aaed5bb9338ef31b0517ccf0ab4414f2093d8
  • github.com/vercel/next.js/security/advisories/GHSA-4342-x723-ch2f
  • nvd.nist.gov/vuln/detail/CVE-2025-57822
  • vercel.com/changelog/cve-2025-57822

Code Behaviors & Features

Detect and mitigate CVE-2025-57822 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 0.9.9 before 14.2.32, all versions starting from 15.0.0-canary.0 before 15.4.7

Fixed versions

  • 14.2.32
  • 15.4.7

Solution

Upgrade to versions 14.2.32, 15.4.7 or above.

Impact 6.5 MEDIUM

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-918: Server-Side Request Forgery (SSRF)

Source file

npm/next/CVE-2025-57822.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 24 Sep 2025 12:18:39 +0000.