CVE-2025-57822
JSON

6.5medium

Next.js Improper Middleware Redirect Handling Leads to SSRF

Severity
6.5medium CVSS:3.1 by GitHub_M
Exploit likelihood
2.85% (higher than 87% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-4342-x723-ch2f

Description

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.

Affected

Product or packageVersionsReported by
vercel next.js< 14.2.32, < 15.4.7, before 14.2.32, from 15.0.0 before 15.4.7CVE List, NVD
next (npm)from 0.9.9 before 14.2.32, from 15.0.0-canary.0 before 15.4.7GitHub Advisory Database

All scores

GitHub_M6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N
GitHub6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N
NVD8.2high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N

Classification

CWE-918

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database

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

NVD (es)

Next.js es un React framework para construir aplicaciones web full-stack. Antes de las versiones 14.2.32 y 15.4.7, cuando se utilizaba next() sin pasar explícitamente el objeto de solicitud, podría conducir a SSRF en aplicaciones autoalojadas que reenviaban incorrectamente los encabezados proporcionados por el usuario. Esta vulnerabilidad ha sido corregida en las versiones 14.2.32 y 15.4.7 de Next.js. Se recomienda encarecidamente a todos los usuarios que implementan lógica de middleware personalizada en entornos autoalojados actualizar y verificar el uso correcto de la función next().

References

Sources

SourceRecordLicence
CVE ListCVE-2025-57822 changed 2025-09-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-4342-x723-ch2f changed 2026-09-10CC-BY-4.0
NVDCVE-2025-57822 changed 2026-10-18Public domain