p PatchFirst

CVE-2025-57822

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

This page contains facts from public vulnerability sources. Check the original advisory before updating.

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.

CVSS 6.5 · Medium · EPSS 2.6% · Public exploit · Fix available

Published
Updated

Stack: node

Affected products and versions

  • next.js

    Versions
    • < 14.2.32: Affected
    • < 15.4.7: Affected

    No fix published

  • next npm

    Affected ranges
    • SEMVER: ≥ 0.9.9, < 14.2.32

    Update to 14.2.32

  • next npm

    Affected ranges
    • SEMVER: ≥ 15.0.0-canary.0, < 15.4.7

    Update to 15.4.7

Original sources

Check your server →