Skip to main content

Next.js CVE-2026-44572

MEDIUM
Acceptance of Extraneous Untrusted Data With Trusted Data (CWE-349)
2026-05-11 https://github.com/vercel/next.js GHSA-3g8h-86w9-wvmq
5.9
CVSS 3.1 · NVD
View

Attack ChainAIDerived

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

  1. Recon
    Send HTTP request with x-nextjs-data header
  2. Delivery
    Next.js middleware mishandles as internal data request
  3. Exploit
    Server returns x-nextjs-redirect instead of Location header
  4. Install
    CDN caches broken 3xx response
  5. C2
    Subsequent users receive cached response without Location header
  6. Execute
    Browser cannot follow redirect
  7. Impact
    Denial of service for affected path

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V4 - API and Web Service Acceptance of extraneous untrusted data
Exploitation Conditions

Three specific conditions must be met: (1) The application uses Next.js middleware or proxy features that return 3xx redirect responses. (2) The application is deployed behind a CDN or reverse proxy that caches HTTP responses. (3) That caching layer does not vary its cache key on the x-nextjs-data header, meaning it treats requests with and without this header identically for caching purposes. If any of these three conditions is absent, the vulnerability cannot be exploited. The attack requires no authentication, no special user interaction, and no special privileges; it is a simple HTTP request from any external client. The x-nextjs-data header is present in a normal HTTP request; the attacker does not need to bypass network firewalls or access controls to send it. However, the high CVSS complexity (AC:H) reflects that the precise combination of middleware redirects, caching, and cache-key configuration must align, making opportunistic mass exploitation unlikely.

Impact

CVSS 3.7 (low severity by score) reflects AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L - network-accessible, high complexity, no privileges or user interaction, availability impact only. However, real-world risk hinges on three specific conditions: (1) the application uses middleware or proxy redirects, (2) it is deployed behind a caching CDN or reverse proxy, and (3) that proxy caches 3xx responses without differentiating on x-nextjs-data. The high complexity (AC:H) reflects that all three conditions must align for exploitation; neither widespread nor trivial. No EPSS score, CVSS vector analysis, or KEV status provided in input, but the attack is straightforward once conditions are met - a single HTTP request with a spoofed header. Impact is denial of service affecting a specific redirect path, not data breach or code execution. For organizations with default CDN configurations that do not vary cache on custom headers, risk is elevated; for those with existing cache-key variance or no caching of 3xx responses, risk is low. Patch availability (15.5.16, 16.2.5) reduces risk significantly for those able to upgrade promptly.

Exploit ScenarioDerived

An attacker identifies a Next.js application deployed behind Cloudflare or similar CDN with middleware that redirects /old-path to /new-path. The attacker sends an HTTP GET request to /old-path with the header x-nextjs-data: 1. The Next.js server, trusting the header, returns a 302 response with x-nextjs-redirect: /new-path instead of the standard Location: /new-path header. The CDN caches this broken response (cache key does not vary on x-nextjs-data by default). For the next 24 hours (or until cache expiration), all users requesting /old-path receive the cached broken redirect without a Location header, causing their browsers to display an error or blank page, resulting in denial of service for that redirect path.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – May 11, 2026

Cache poisoning in Next.js middleware redirect handling allows attackers to inject a malicious x-nextjs-data request header, causing middleware to replace the standard Location header with an internal x-nextjs-redirect header that browsers ignore. When deployed behind a CDN or reverse proxy that caches 3xx responses without varying on this header, a single attacker request can poison the cached redirect, resulting in denial of service for that redirect path for all subsequent visitors until cache expiration. Affects Next.js versions 12.2.0-15.5.15 and 16.0.0-16.2.4; vendor-released patches available in 15.5.16 and 16.2.5.

RemediationAI

Upgrade Next.js to version 15.5.16 (for the 15.x branch) or 16.2.5 (for the 16.x branch) or later. These versions validate x-nextjs-data against internal routing state, eliminating the header injection vector. Before upgrading, configure your CDN or reverse proxy to vary the cache key on the x-nextjs-data header for all 3xx responses, preventing cache poisoning even if external clients send the header. This workaround has minimal performance impact (adds one header to the cache key) and does not alter application behavior. Alternatively, disable caching of 3xx responses on the affected middleware redirect paths if feasible, though this may increase origin load. Monitor CDN cache-hit ratios after applying the cache-key variance to ensure the workaround does not degrade performance unacceptably; for most deployments, the overhead is negligible.

Affected Packages

npm next fix: 15.5.16, 16.2.5

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 uses the x-nextjs-data request header internally to signal data requests from the client-side router, allowing the server to return optimized responses without full page HTML. The vulnerability stems from CWE-349 (Acceptance of Extraneous Untrusted Data Element) - the middleware logic trusted the x-nextjs-data header itself without validating it against internal routing state. When an external attacker spoofs this header on a normal request to a path handled by middleware that returns a 3xx redirect, the server incorrectly treats it as an internal data request and substitutes the standard HTTP Location header with the proprietary x-nextjs-redirect header. Since browsers do not follow x-nextjs-redirect, the response becomes unusable. If a CDN or reverse proxy caches 3xx responses with a cache key that does not vary on x-nextjs-data (a common default behavior), a single attacker request populates the cache with a broken redirect, poisoning it for all downstream users. The fix validates x-nextjs-data only when corroborated by internal routing state, preventing external header injection from altering redirect behavior.

Know when the next one hits your stack

  • 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 5.9 MEDIUM
AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Red Hat 5.9 MEDIUM

Primary rating from NVD.

CVSS VectorNVD

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

Lifecycle Timeline

3
Severity Changed
Oct 26, 2026 - 18:23 NVD
LOW MEDIUM
CVSS changed
Oct 26, 2026 - 18:23 NVD
3.7 (LOW) 5.9 (MEDIUM)
CVE Published
May 11, 2026 - 16:12 nvd
LOW 3.7

DescriptionNVD

Impact

Next.js uses the x-nextjs-data request header for internal data requests. On affected versions, an external client could send this header on a normal request to a path handled by middleware that returns a redirect.

When that happened, the middleware/proxy could treat the request as a data request and replace the standard Location redirect header with the internal x-nextjs-redirect header. Browsers do not follow x-nextjs-redirect, so the response became an unusable redirect for normal clients.

If the application was deployed behind a CDN or reverse proxy that caches 3xx responses without varying on this header, a single attacker request could poison the cached redirect response for the affected path. Subsequent visitors could then receive a cached redirect response without a Location header, causing a denial of service for that redirect path until the cache entry expired or was purged.

Affected scenarios

This affects applications that:

  • use middleware or proxy redirects
  • are deployed behind a caching CDN or reverse proxy
  • allow 3xx responses on those paths to be cached without differentiating internal data requests from normal requests

Fix

The fix stops trusting x-nextjs-data by itself for middleware redirect handling. A request is now treated as an internal data request only when it is validated as such by internal routing state, preserving legitimate data-request redirect behavior while preventing external header injection from changing normal redirect responses.

Workarounds

Before upgrading, users can reduce risk by:

  • configuring the CDN or reverse proxy to vary its cache key on x-nextjs-data for affected responses

Threat Intelligence Overview

EPSS Score
0.0%
Top 100% exploitable
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment GHSA Vendor CIRCL GitHub VulDB

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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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
Defer
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Affected Products (CPE)NVD

pkg:npm/next
pkg:npm/next

Vendor StatusVendor

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