CVE-2026-64645

Next.js: Server-Side Request Forgery in rewrites via attacker-controlled destination hostname

Published Jul 27, 2026 CVSS 4.0 · 8.3 High EPSS < 1% KEV · Not listed
Description
Next.js is a React framework for building full-stack web applications. In versions 12.0.0 through 15.5.20 and 16.0.0 through 16.2.10, a
rewrites() or redirects() rule that builds its external destination hostname from request-controlled input can be pointed at an arbitrary hostname, regardless of the rule's hostname suffix. For a rewrite, Next.js proxies the request to that arbitrary host and serves the response from the application's origin, leading to Server-Side Request forgery. A redirects() rule configured this way is vulnerable to an Open Redirect. This issue has been fixed in versions 15.5.21 and 16.2.11.

Analysis

AI-generated

Technical impact

Next.js allows users to define rewrite and redirect rules that build the external destination hostname from request‑controlled input. When a rewrite rule points to an arbitrary hostname, Next.js proxies the request to that host and streams the response back to the application’s origin, creating a Server‑Side Request Forgery (SSRF) condition. A redirect rule configured in the same way becomes an Open Redirect. This flaw is governed by CWE‑601 and CWE‑918 and, if exploited, can enable external actors to probe internal network services or exfiltrate data through the application’s server.

Affected Systems

The affected product is Vercel’s Next.js framework. Versions from 12.0.0 to 15.5.20 inclusive and from 16.0.0 to 16.2.10 inclusive are vulnerable. The security fixes are included in releases 15.5.21 and 16.2.11.

Risk and Exploitability

The CVSS score of 8.3 indicates high severity with full exploitation potential. EPSS score is < 1%, and the vulnerability is not listed in CISA’s KEV catalog, suggesting limited, but possible, attack prevalence. The likely attack vector involves an unauthenticated remote attacker crafting a request that triggers a rewrite or redirect rule with a malicious destination hostname, thereby executing the SSRF or being redirected to an external site.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Next.js to version 15.5.21 or newer (or 16.2.11 or newer if using v16).
  • Review all rewrite() and redirects() configurations to ensure that destination hostnames are not constructed from user‑controlled input or from untrusted sources.
  • Disable or restrict any dynamic rewrite or redirect functionality until a vendor patch has been applied.

Generated by OpenCVE AI on August 3, 2026 at 17:06 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-p9j2-gv94-2wf4 Next.js: Server-Side Request Forgery in rewrites via attacker-controlled destination hostname
History
Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 8.2, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N'}

threat_severity

Important

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Vercel
Vercel next.js
Vendors & Products Vercel
Vercel next.js
Type Values Removed Values Added
Description Next.js is a React framework for building full-stack web applications. In versions 12.0.0 through 15.5.20 and 16.0.0 through 16.2.10, a rewrites() or redirects() rule that builds its external destination hostname from request-controlled input can be pointed at an arbitrary hostname, regardless of the rule's hostname suffix. For a rewrite, Next.js proxies the request to that arbitrary host and serves the response from the application's origin, leading to Server-Side Request forgery. A redirects() rule configured this way is vulnerable to an Open Redirect. This issue has been fixed in versions 15.5.21 and 16.2.11.
Title Next.js: Server-Side Request Forgery in rewrites via attacker-controlled destination hostname
Weaknesses CWE-601
CWE-918
References
Metrics cvssV4_0

{'score': 8.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/VA:N/SC:L/SI:L/SA:N'}

Weaknesses
  • CWE-601

    URL Redirection to Untrusted Site ('Open Redirect')

  • CWE-918

    Server-Side Request Forgery (SSRF)

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 28, 2026, 2:02 PM
Reserved
Jul 20, 2026, 5:11 PM
Status
Analyzed
Published
Jul 27, 2026, 6:16 PM
Modified
Oct 24, 2026, 1:10 PM
Severity
Important
Public date
Jul 27, 2026, 5:37 PM