Next.js CVE-2026-44581
MEDIUMAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconAttacker crafts malicious CSP header
-
DeliverySends HTTP request to application endpoint
-
ExploitVulnerable app reflects unvalidated nonce into HTML
-
InstallShared cache stores poisoned response
-
C2Victim visits application
-
ExecuteBrowser renders poisoned cached HTML
-
ImpactAttacker'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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
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
AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
Primary rating from Vendor (https://github.com/vercel/next.js).
CVSS VectorVendor: https://github.com/vercel/next.js
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- 4 npm packages depend on next (4 direct, 0 indirect)
Ecosystem-wide dependent count for version 13.4.0.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
GHSA-ffhc-5mcf-pf4q
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB