{"id":"CVE-2025-57822","aliases":["CVE-2025-57822","GHSA-4342-x723-ch2f"],"related":[],"kind":"vulnerability","state":"published","title":"Next.js Improper Middleware Redirect Handling Leads to SSRF","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"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.\n\nAll users implementing custom middleware logic in self-hosted environments are strongly encouraged to upgrade and verify correct usage of the `next()` function.\n\nMore details at [Vercel Changelog](https://vercel.com/changelog/cve-2025-57822)","format":"markdown","source":"ghsa"},{"lang":"es","text":"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().","source":"nvd"}],"published":"2025-08-29T21:33:09.000Z","modified":"2026-10-18T21:10:00.120Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N","score":8.2,"rating":"HIGH"}],"cwes":["CWE-918"],"affected":[{"ranges":[{"version":"< 14.2.32","status":"affected"},{"version":"< 15.4.7","status":"affected"}],"vendor":"vercel","product":"next.js","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.9.9","status":"affected","fixed":"14.2.32"}],"ecosystem":"npm","package":"next","purl":"pkg:npm/next","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"15.0.0-canary.0","status":"affected","fixed":"15.4.7"}],"ecosystem":"npm","package":"next","purl":"pkg:npm/next","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"14.2.32"},{"status":"affected","introduced":"15.0.0","fixed":"15.4.7"}],"vendor":"vercel","product":"next.js","cpe":"cpe:2.3:a:vercel:next.js:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/vercel/next.js/security/advisories/GHSA-4342-x723-ch2f","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vercel/next.js/commit/9c9aaed5bb9338ef31b0517ccf0ab4414f2093d8","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://vercel.com/changelog/cve-2025-57822","tags":["mitigation","vendor-advisory","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-57822","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/vercel/next.js","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-09-02T17:26:15.763Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-57822","url":"https://www.cve.org/CVERecord?id=CVE-2025-57822","licence":"CVE Terms of Use","modified":"2025-09-02T17:26:25.016Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4342-x723-ch2f","url":"https://github.com/advisories/GHSA-4342-x723-ch2f","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:26.545Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-57822","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-57822","licence":"Public domain","modified":"2026-10-18T21:10:00.120Z"}],"updatedAt":"2026-11-25T22:59:03.909Z","epss":{"score":0.02848,"percentile":0.87081,"date":"2026-12-01T12:00:22.000Z"}}