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 products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| vercel | next.js | >= 13.4.0, < 14.1.1 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Wolfi
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | jitsucom-jitsu +2 | 2.8.0-r0 | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 4 repositories
-
Voorivex/CVE-2024-34351 ★ 10 · May 12, 2024
-
God4n/nextjs-CVE-2024-34351-_exploit ★ 9 · Aug 27, 2024
PoC for a full exploitation of NextJS SSRF (CVE-2024-34351)
-
avergnaud/Next.js_exploit_CVE-2024-34351 ★ 1 · Jun 11, 2024
-
Jinlei-Chen-UWO/cve-2024-34351-demo ★ 0 · Apr 12, 2026
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Automated scanner template
A ready-made Nuclei template detects this vulnerability automatically. Vulnerabilities with public scanner templates are typically probed across the internet soon after the template appears — exposed systems should be patched first.
- Next.js - Server Side Request Forgery (SSRF) http/cves/2024/CVE-2024-34351.yaml
Source: projectdiscovery/nuclei-templates (MIT) — updated daily. Only links are listed.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| npm | next | >= 13.4.0, < 14.1.1 | 14.1.1 | GHSA-fr5h-rqp8-mj6g |