CVE-2026-44581: Next.js: Cross-site scripting in App Router applications using CSP nonces
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.
Other sources
Next.js is a React framework for building full-stack web applications. From 13.4.0 to before 15.5.16 and 16.2.5, 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. This vulnerability is fixed in 15.5.16 and 16.2.5.
— MITRE
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-44581?
CVE-2026-44581 has a high severity level due to its potential for stored cross-site scripting attacks.
How do I fix CVE-2026-44581?
To fix CVE-2026-44581, upgrade to Next.js version 16.2.5 or 15.5.16.
Which versions of Next.js are affected by CVE-2026-44581?
Next.js versions 13.4.0 to 15.5.16 and 16.0.0 to 16.2.5 are affected by CVE-2026-44581.
What type of vulnerability is CVE-2026-44581?
CVE-2026-44581 is a cross-site scripting vulnerability occurring in App Router applications using CSP nonces.
What causes the vulnerability in CVE-2026-44581?
The vulnerability in CVE-2026-44581 is caused by malformed nonce values derived from request headers when deployed behind shared caches.