next.js: Server-Side Request Forgery
CVE-2024-34351 is a high-severity server-side request forgery vulnerability in next.js from Vercel, with a CVSS 3.1 base score of 7.5 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. The record lists version 14.1.1 as the first without the flaw, so updating next.js to that release or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 5.45% chance of exploitation within 30 days, which is in the top 7.13% of all scored CVEs.
High severity with no evidence of exploitation so far.
What to do
- Update next.js to 14.1.1 or a later version.
- Read the advisory on github.com for workarounds and exact fixed builds.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Vercel | next.js | >= 13.4.0, < 14.1.1; 13.4.0 up to, but not including, 14.1.1 | 14.1.1 |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- NoneNo data is disclosed.
- Integrity
- HighData or code can be modified at will.
- Availability
- NoneAvailability is not affected.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 7.5 | High | CNA (github.com) |
| CVSS 3.1 | 7.5 | High | NVD |
Official 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`.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Server-Side Request Forgery
The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.
How developers prevent this class of flaw
- If there is a known list of applications, IP, hostname, and/or domains to which the product is allowed to communicate, then use allowlists to ensure that outgoing requests are restricted to these known entities. The allowlists could be in the application code or possibly enforced by firewalls or network segmentation.
- If the product is expected to be able to connect to arbitrary IP addresses or domains, consider using a denylist that includes private network addresses, internal domain names, etc. The denylist could be in the application code or possibly enforced by firewalls or network segmentation.
Timeline
- CISA published its SSVC assessment (exploitation: none, automatable: yes, technical impact: partial).
- CVE record published.
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
Other vulnerabilities in next.js
- 8.2 High severity
- 9.0 Critical severity
- 8.2 High severity
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
Recent Server-Side Request Forgery vulnerabilities
- 7.2 High severity
- 9.0 Critical severity
- 9.6 Critical severity
- 7.2 High severity
- 9.8 Critical severity
- 8.3 High severity
Spotted an error? Tell us.