CVE-2025-57822
HIGH 8.2CVSS 3.1Next.js Improper Middleware Redirect Handling Leads to SSRF
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.
- Published
- 29 Aug 2025
- Last modified
- 18 Oct 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Analyzed
- Weakness
- CWE-918
- Also known as
- GHSA-4342-x723-ch2f
- Sources
- NVDJSONOSV GHSA-4342-x723-ch2fJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | HIGH 8.2 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | MEDIUM 6.5 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 6.5 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | vercel | next.jscpe:2.3:a:vercel:next.js:*:*:*:*:*:node.js:*:* |
< 14.2.32 | 14.2.32 |
| NVD | vercel | next.jscpe:2.3:a:vercel:next.js:*:*:*:*:*:node.js:*:* |
>= 15.0.0, < 15.4.7 | 15.4.7 |
| OSV | npm | next | >= 0.9.9, < 14.2.32 | 14.2.32 |
| OSV | npm | next | >= 15.0.0-canary.0, < 15.4.7 | 15.4.7 |
References
- https://github.com/vercel/next.js/commit/9c9aaed5bb9338ef31b0517ccf0ab4414f2093d8 · Patch, WEB
- https://github.com/vercel/next.js/security/advisories/GHSA-4342-x723-ch2f · Vendor Advisory, WEB
- https://vercel.com/changelog/cve-2025-57822 · Mitigation, Vendor Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2025-57822 · ADVISORY
- https://github.com/vercel/next.js · PACKAGE
History
- 25 Nov 2026 20:58 UTC · NVD: first stored (published 29 Aug 2025)
- 25 Nov 2026 20:10 UTC · OSV: first stored (published 29 Aug 2025)