Skip to main content

Next.js CVE-2025-57822

HIGH
Server-Side Request Forgery (SSRF) (CWE-918)
2025-08-29 security-advisories@github.com
8.2
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Send crafted request with attacker headers
  2. Delivery
    Headers forwarded via next() in middleware
  3. Exploit
    Location header mishandled as redirect
  4. Execution
    Server issues request to internal target
  5. Impact
    Access internal/metadata resources (SSRF)

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V4 - API and Web Service URL allowlisting, SSRF prevention
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Credential Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitable ONLY against SELF-HOSTED Next.js deployments running custom middleware that calls next()/NextResponse.next() WITHOUT explicitly passing the request object, such that user-supplied incoming request headers are forwarded into the response (per the GHSA, sensitive request headers reflected back). The underlying defect (fixed in commit 9c9aaed) is that a Location response header was treated as a redirect/rewrite regardless of HTTP status code; affected versions are next < 14.2.32 (14.x branch) and >=15.0.0-canary.0 < 15.4.7 (15.x branch). LIMITING FACTORS: requires the application developer to have implemented the vulnerable middleware/header-forwarding pattern (non-default custom code), so stock apps without such middleware are not affected; no authentication (PR:N) or user interaction (UI:N) is needed once a vulnerable app is deployed. Upgrading to 14.2.32 or 15.4.7 and verifying correct next() usage remediates it.

Impact

This is a genuine but conditional-risk SSRF (CWE-918). NVD's CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N, 8.2 High) describes network, unauthenticated, no-interaction exploitation with high confidentiality impact - which taken alone looks like a top priority. However, the description and the GHSA advisory both constrain this heavily: it only affects SELF-HOSTED Next.js applications that use CUSTOM MIDDLEWARE which incorrectly passes user-supplied request headers into NextResponse.next() (i.e. calls next() without explicitly passing the request object). This is a non-default coding pattern, so the AC:L in the official vector arguably understates the real-world precondition - I assess attack complexity as higher once the deployment dependency is accounted for. Supporting signals are mixed-to-moderate: a public POC/exploit exists and EPSS is 5.63% at the 90th percentile (elevated relative to most CVEs, consistent with POC availability and the popularity of Next.js), but the CVE is NOT in CISA KEV and there is no evidence of active exploitation. No SSVC decision data was provided in the input. Net assessment: a real, patch-worthy issue for self-hosted Next.js operators with custom middleware, but NOT an indiscriminate internet-wide emergency - exposure is gated on the application's own middleware implementation. Vercel-hosted deployments are not the focus of the advisory.

Exploit ScenarioDerived

A remote, unauthenticated attacker sends an HTTP request with crafted sensitive headers to a self-hosted Next.js app whose custom middleware forwards incoming request headers into NextResponse.next(); the server then reflects/acts on those headers (e.g. a Location header treated as a redirect/rewrite) to make the server issue requests to attacker-chosen internal endpoints. A public exploit/POC is reported available, and the fix commit shows the root cause was a Location response header being improperly treated as a redirect regardless of status code. Because CVSS is AV:N/AC:L/PR:N, no authentication or user interaction is required once a vulnerable middleware pattern is deployed.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 5.6% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv3 – Oct 18, 2026

Server-side request forgery in Vercel Next.js affects self-hosted deployments whose custom middleware calls next()/NextResponse.next() without explicitly passing the request object and forwards user-controlled headers into the response. An unauthenticated remote attacker can supply crafted headers, notably a Location header with a non-redirect status, causing affected middleware routing to treat it as a redirect/rewrite and make server-side requests to attacker-chosen destinations, with high confidentiality and limited integrity impact. Public exploit code exists and EPSS is 5.63% (90th percentile), but CISA KEV does not list it; exploitation is conditional on the non-default middleware pattern, and fixes are available in 14.2.32 and 15.4.7.

Earlier versions of this analysis (2)
v2 Oct 18, 2026 - 22:13 cvss changed CVSS 8.2

Server-side request forgery in Next.js middleware affects self-hosted deployments running versions 0.9.9 through 14.2.31 and 15.0.0-canary.0 through 15.4.6, where custom middleware that calls next()/NextResponse.next() without explicitly passing the request object can reflect user-supplied sensitive headers, and a non-redirect Location header is then mishandled as a rewrite target. Unauthenticated remote attackers who can influence those headers may cause the server to issue requests to attacker-chosen internal or external destinations, yielding high confidentiality impact with limited integrity impact (assessed CVSS 8.2 / AC:H). Exploit code is publicly available and EPSS is 5.63% (90th percentile), but there is no confirmed active exploitation (not in CISA KEV), and exposure is gated by self-hosting plus a specific insecure middleware implementation.

v1 Mar 28, 2026 - 19:09 CVSS 6.5

Next.js is a React framework for building full-stack web applications. Rated medium severity (CVSS 6.5), this vulnerability is remotely exploitable, no authentication required. This Server-Side Request Forgery (SSRF) vulnerability could allow attackers to make the server perform requests to unintended internal or external resources.

RemediationAI

Upgrade Next.js to 14.2.32 or 15.4.7 (vendor-released patch) and audit custom middleware to ensure next()/NextResponse.next() is called with the request object where header forwarding is intended. Do not reflect arbitrary incoming headers into responses; explicitly allowlist headers and validate Location values, and only treat 3xx redirect statuses as redirects. For immediate compensating controls on self-hosted deployments that cannot patch, strip untrusted Location headers in middleware/reverse proxy and restrict outbound network egress from the Next.js server to trusted destinations; trade-offs are possible breakage of legitimate redirects or integrations that depend on header reflection or outbound fetches. Refer to GHSA-4342-x723-ch2f, the Vercel changelog, and commit 9c9aaed5bb9338ef31b0517ccf0ab4414f2093d8.

Affected Packages

npm next fix: 14.2.32, 15.4.7

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Next.js middleware executes before routing and can return NextResponse.next() to continue request handling. In vulnerable versions, resolve-routes.ts processed a Location response header as a redirect/rewrite based on the presence of the header rather than validating that the middleware response status was an allowed redirect status. Commit 9c9aaed changes this to check allowedStatusCodes and, for non-redirect statuses, pass the Location header through without parsing it as a relative URL/redirect. This is CWE-918: when custom self-hosted middleware reflects incoming request headers into the response without passing the request object to next(), an attacker-controlled Location header can induce server-side fetches to arbitrary URLs. The fix narrows redirect handling and adds tests for a non-redirect Location header. CPE data identifies Vercel Next.js on Node.js; stock apps without this middleware/header-forwarding pattern are not affected.

Know when Next Js gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

NVD PRIMARY 8.2 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N
vuln.today AI 6.5 MEDIUM

Network, unauthenticated, no-interaction (AV:N/PR:N/UI:N), but AC:H because exploitation depends on a non-default self-hosted custom-middleware misconfiguration; SSRF yields C:H, minor I:L, no availability impact.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
Low
Availability
None

Lifecycle Timeline

6
Analysis Updated
Oct 18, 2026 - 22:14 vuln.today
v3 - CVSS changed
Analysis Updated
Oct 18, 2026 - 22:13 vuln.today
v2 - CVSS changed
Severity Changed
Oct 18, 2026 - 21:38 NVD
MEDIUM HIGH
CVSS changed
Oct 18, 2026 - 21:38 NVD
6.5 (MEDIUM) 8.2 (HIGH)
Patch released
Mar 28, 2026 - 19:09 nvd
Patch available
CVE Published
Aug 29, 2025 - 22:15 nvd
MEDIUM 6.5

DescriptionNVD

Next.js is a React framework for building full-stack web applications. Prior to versions 14.2.32 and 15.4.7, when next() was used without explicitly passing the request object, it could lead to SSRF in self-hosted applications that incorrectly forwarded user-supplied headers. This vulnerability has been fixed in Next.js versions 14.2.32 and 15.4.7. All users implementing custom middleware logic in self-hosted environments are strongly encouraged to upgrade and verify correct usage of the next() function.

Executive ViewAI

Why It Matters

Vercel Next.js (CVE-2025-57822) carries a high-severity server-side request forgery risk for self-hosted applications using a specific custom middleware pattern, potentially exposing internal services or sensitive data to attacker-chosen destinations. Exploit status is notable because publicly available exploit code exists, but exploitation depends on that non-default configuration and the issue is not listed in CISA KEV. Leadership should prioritize inventory and remediation of internet-facing self-hosted Next.js deployments because vendor-released fixes are available in 14.2.32 and 15.4.7.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
5.6%
Top 10% exploitable
Prevalence
High
Next.js is one of the most widely deployed React web frameworks
Exploit
POC
Public exploit code exists
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 5.6%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Out-of-Cycle
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

67
Low Medium High Critical
KEV: 0
EPSS: +6
CVSS: +41
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Server-Side Request Forgery exploits applications that fetch remote resources based on user-supplied URLs.

Affected Products (CPE)NVD

cpe:2.3:a:vercel:next.js:*:*:*:*:*:node.js:*:*
cpe:2.3:a:vercel:next.js:*:*:*:*:*:node.js:*:*
CVE-2025-55182 CRITICAL POC
10.0 Dec 03

React Server Components in React 19.x contain a critical pre-authentication remote code execution vulnerability (CVE-202

CVE-2017-16877 HIGH POC
7.5 Nov 17

ZEIT Next.js before 2.4.1 has directory traversal under the /_next and /static request namespace, allowing attackers to

CVE-2025-55184 HIGH POC
7.5 Dec 11

Pre-authentication denial of service in React Server Components (versions 19.0.0 through 19.2.1) allows unauthenticated

CVE-2025-55183 MEDIUM POC
5.3 Dec 11

Information disclosure in React Server Components 19.x, distributed as react-server-dom-webpack, react-server-dom-turbop

CVE-2026-75604 CRITICAL POC
9.0 Sep 01

Path traversal in Next.js (13.4.0 through 15.5.23 and 16.x before 16.3.3) running on Windows-hosted servers lets a remot

CVE-2024-34351 HIGH POC
7.5 May 14

Next.js is a React framework that can provide building blocks to create web applications. Rated high severity (CVSS 7.5)

CVE-2023-46298 HIGH POC
7.5 Oct 22

Next.js before 13.4.20-canary.13 lacks a cache-control header and thus empty prefetch responses may sometimes be cached

CVE-2018-6184 HIGH POC
7.5 Jan 24

ZEIT Next.js 4 before 4.2.3 has Directory Traversal under the /_next request namespace. Rated high severity (CVSS 7.5),

CVE-2025-67779 HIGH
7.5 Dec 12

Unsafe deserialization in React Server Components Server Function endpoints allows remote unauthenticated attackers to t

CVE-2026-119790 MEDIUM POC
6.3 Nov 16

Cached-data disclosure in Next.js 16.3.0 through 16.4.4 lets a request for one root-param value (for example one locale

CVE-2026-119351 MEDIUM POC
6.3 Nov 16

Next.js 16.2.0 through 16.4.4 with the opt-in Cache Components feature can persist an outer 'use cache' entry under a ke

CVE-2026-94483 HIGH
8.3 Oct 02

Server-side request forgery in the Next.js Image Optimization endpoint lets a remote, unauthenticated attacker cause the

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy