CVE-2024-34351: Next.js Server-Side Request Forgery in Server Actions
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
Other sources
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.
— MITRE
Affected Software
Remediation
Patch Available
Event History
Frequently Asked Questions
What is the severity of CVE-2024-34351?
CVE-2024-34351 is classified as a moderate severity Server-Side Request Forgery (SSRF) vulnerability in Next.js.
How do I fix CVE-2024-34351?
To mitigate CVE-2024-34351, update Next.js to version 14.1.2 or later.
What versions of Next.js are affected by CVE-2024-34351?
CVE-2024-34351 affects Next.js versions from 13.4.0 to 14.1.1.
What is the nature of the attack for CVE-2024-34351?
CVE-2024-34351 allows an attacker to manipulate the 'Host' header and potentially make unauthorized requests.
Who discovered CVE-2024-34351?
CVE-2024-34351 was discovered by security researchers at Assetnote.