Skip to main content

Next.js CVE-2026-44581

MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-05-11 https://github.com/vercel/next.js GHSA-ffhc-5mcf-pf4q
4.7
CVSS 3.1 · Vendor: https://github.com/vercel/next.js
View

Attack ChainAIDerived

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

  1. Recon
    Attacker crafts malicious CSP header
  2. Delivery
    Sends HTTP request to application endpoint
  3. Exploit
    Vulnerable app reflects unvalidated nonce into HTML
  4. Install
    Shared cache stores poisoned response
  5. C2
    Victim visits application
  6. Execute
    Browser renders poisoned cached HTML
  7. Impact
    Attacker's script executes in victim's context

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

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

Exploitation Conditions

Exploitation requires the following specific conditions: (1) the application must use Next.js App Router with CSP nonce functionality enabled; (2) the application must be deployed behind a shared cache (CDN, reverse proxy, or any caching layer shared across multiple users); (3) the cache must be configured to cache responses based on cookie/session state rather than vary on CSP headers, allowing poisoned responses to be served to other users; (4) the application must accept and process CSP request headers from untrusted traffic without pre-filtering; and (5) the attacker must be able to send crafted HTTP requests to the application (network-accessible endpoint). Default Next.js configurations do not explicitly validate CSP headers before use. The CVSS vector (AC:H) indicates high attack complexity, likely due to the requirement for cache poisoning to succeed (victim must receive the cached response) and the cache configuration constraints. Exploitation does not require authentication (PR:N), but does depend on user interaction (UI:R)-the victim must trigger a normal page request that hits the poisoned cache.

Impact

CVSS 4.7 with AV:N/AC:H/PR:N/UI:R/S:C reflects a moderate network-accessible vulnerability requiring high complexity and user interaction, but with changed scope and dual confidentiality/integrity impact. The high complexity and required user interaction (victim must visit a cached response) are significant limiting factors, yet the scope change (affects resources beyond the vulnerable component) and stored nature (cache poisoning) elevate practical risk in shared-hosting environments. The moderately-rated classification in the v15.5.16 release notes aligns with CVSS. EPSS and KEV data are absent from input, so exploitation prevalence is unconfirmed, but the attack is theoretically viable: an attacker needs only network access, can craft malicious CSP headers to poison shared caches, and subsequent visitors automatically execute injected scripts without additional interaction beyond normal browsing. The workaround (stripping inbound CSP headers) suggests defenders can fully mitigate without patching if they control request preprocessing. Real-world risk depends on deployment architecture-organizations using shared caches (Cloudflare, AWS CloudFront, nginx reverse proxy) and accepting CSP headers from untrusted sources face higher exposure; private/internal deployments with controlled header sources face lower risk.

Exploit ScenarioDerived

An attacker discovers a Next.js App Router application deployed behind a shared cache (e.g., Cloudflare, AWS CloudFront). The attacker sends a crafted HTTP request with a malicious Content-Security-Policy header containing a malformed nonce value (e.g., a nonce with unescaped quotes or angle brackets). The vulnerable application fails to sanitize this nonce and reflects it into the HTML response, which is cached by the shared layer. When a legitimate user visits the application, they receive the poisoned cached response and the attacker's injected JavaScript executes in their browser with their permissions, potentially stealing session cookies or performing actions on their behalf.

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

Cross-site scripting via CSP nonce poisoning in Next.js App Router allows attackers to inject malicious scripts into cached HTML responses when applications process untrusted CSP request headers. Versions 13.4.0-15.5.15 and 16.0.0-16.2.4 are vulnerable; attackers can craft malformed nonce values that escape sanitization and execute arbitrary JavaScript for subsequent cache visitors. No public exploit code identified at time of analysis, but the attack requires no authentication and low user interaction (cache hit by victim), making it practically exploitable in shared hosting and CDN scenarios.

RemediationAI

Upgrade Next.js immediately to version 15.5.16 (for 13.4.0-15.x users) or 16.2.5 (for 16.0.0-16.x users). Both versions apply stricter nonce sanitization and reject malformed nonce values before HTML embedding. If immediate upgrade is not feasible, implement a temporary workaround by stripping all inbound Content-Security-Policy request headers from untrusted traffic sources at your reverse proxy, load balancer, or WAF layer (e.g., nginx proxy_set_header CSP ""; or Cloudflare page rule to remove header). This workaround eliminates the attack vector but disables legitimate CSP nonce handling from clients and requires redeployment once patched. For applications behind shared caches, coordinate cache invalidation after upgrading to purge any previously poisoned responses; consider using versioned cache keys or Cache-Control headers during the upgrade window.

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 App Router implements Content-Security-Policy (CSP) nonces to protect inline scripts from injection attacks. The vulnerability stems from insufficient validation of nonce values extracted from inbound CSP request headers before embedding them into HTML attributes. When these nonce values are malformed, the application fails to properly escape or sanitize them before rendering, allowing an attacker to break out of the attribute context and inject arbitrary HTML/script tags. This is a classic stored XSS scenario exacerbated by shared caching layers (proxies, CDNs) that cache and serve the poisoned response to subsequent users. CWE-79 (Improper Neutralization of Input During Web Page Generation) captures the root cause: the framework reflects unsanitized, attacker-controlled CSP header data into HTML without proper output encoding.

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

Vendor (https://github.com/vercel/next.js) PRIMARY 4.7 MEDIUM
AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
Red Hat 4.2 MEDIUM

Primary rating from Vendor (https://github.com/vercel/next.js).

CVSS VectorVendor: https://github.com/vercel/next.js

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

DescriptionCVE.org

Impact

App Router applications that rely on CSP nonces can be vulnerable to stored cross-site scripting when deployed behind shared caches. In affected versions, malformed nonce values derived from request headers could be reflected into rendered HTML in an unsafe way, allowing an attacker to poison cached responses and cause script execution for later visitors.

Fix

We now reject or ignore malformed nonce values before they are embedded into HTML and apply stricter nonce sanitization so request-derived nonce data cannot break out of the intended attribute context.

Workarounds

If you cannot upgrade immediately, strip inbound Content-Security-Policy request headers from untrusted traffic.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 4 npm packages depend on next (4 direct, 0 indirect)

Ecosystem-wide dependent count for version 13.4.0.

Threat Intelligence Overview

EPSS Score
0.0%
Top 89% exploitable
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
7 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
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

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

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Affected Products (CPE)CVE.org

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