7.5high
Next.js Server-Side Request Forgery in Server Actions
- Severity
- 7.5high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 5.45% (higher than 92% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-fr5h-rqp8-mj6g
Description
Next.js is a React framework that can provide building blocks to create web applications. A Server-Side Request Forgery (SSRF) vulnerability was identified in Next.js Server Actions. If the `Host` header is modified, and the below conditions are also met, an attacker may be able to make requests that appear to be originating from the Next.js application server itself. The required conditions are 1) Next.js is running in a self-hosted manner; 2) the Next.js application makes use of Server Actions; and 3) the Server Action performs a redirect to a relative path which starts with a `/`. This vulnerability was fixed in Next.js `14.1.1`.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| vercel next.js | >= 13.4.0, < 14.1.1, from 13.4.0 before 14.1.1 | CVE List, NVD |
| next (npm) | from 13.4.0 before 14.1.1 | GitHub Advisory Database |
All scores
| GitHub_M | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
Next.js is a React framework that can provide building blocks to create web applications. A Server-Side Request Forgery (SSRF) vulnerability was identified in Next.js Server Actions. If the `Host` header is modified, and the below conditions are also met, an attacker may be able to make requests that appear to be originating from the Next.js application server itself. The required conditions are 1) Next.js is running in a self-hosted manner; 2) the Next.js application makes use of Server Actions; and 3) the Server Action performs a redirect to a relative path which starts with a `/`. This vulnerability was fixed in Next.js `14.1.1`.
GitHub Advisory Database
Impact
A Server-Side Request Forgery (SSRF) vulnerability was identified in Next.js Server Actions by security researchers at Assetnote. If the Host header is modified, and the below conditions are also met, an attacker may be able to make requests that appear to be originating from the Next.js application server itself.
Prerequisites
- Next.js (
<14.1.1) is running in a self-hosted* manner. - The Next.js application makes use of Server Actions.
- The Server Action performs a redirect to a relative path which starts with a
/.
* Many hosting providers (including Vercel) route requests based on the Host header, so we do not believe that this vulnerability affects any Next.js applications where routing is done in this manner.
Patches
This vulnerability was patched in #62561 and fixed in Next.js 14.1.1.
Workarounds
There are no official workarounds for this vulnerability. We recommend upgrading to Next.js 14.1.1.
Credit
Vercel and the Next.js team thank Assetnote for responsibly disclosing this issue to us, and for working with us to verify the fix. Thanks to:
Adam Kues - Assetnote Shubham Shah - Assetnote
NVD (es)
Next.js es un framework React que puede proporcionar componentes básicos para crear aplicaciones web. Se identificó una vulnerabilidad de Server Side Request Forgery (SSRF) en las acciones del servidor Next.js. Si se modifica el encabezado "Host" y también se cumplen las condiciones siguientes, un atacante puede realizar solicitudes que parecen originarse en el propio servidor de aplicaciones Next.js. Las condiciones requeridas son 1) Next.js se ejecuta de forma autohospedada; 2) la aplicación Next.js utiliza acciones del servidor; y 3) la Acción del Servidor realiza una redirección a una ruta relativa que comienza con `/`. Esta vulnerabilidad se solucionó en Next.js `14.1.1`.
References
| https://github.com/vercel/next.js/security/advisories/GHSA-fr5h-rqp8-mj6g | vendor-advisory, web | |
| https://github.com/vercel/next.js/pull/62561 | issue-tracking, patch, web | |
| https://github.com/vercel/next.js/commit/8f7a6ca7d21a97bc9f7a1bbe10427b5ad74b9085 | patch, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2024-34351 | advisory | |
| https://github.com/vercel/next.js | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-34351 changed 2024-08-02 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-fr5h-rqp8-mj6g changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2024-34351 changed 2026-06-17 | Public domain |