Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-114061 Overview
CVE-2026-114061 is a cross-site scripting (XSS) vulnerability in SvelteKit (@sveltejs/kit) versions before 3.0.0. The flaw affects prerendered pages where a cache-control header value set via setHeaders is inserted without escaping into a <meta http-equiv="cache-control"> tag. An attacker who can influence that untrusted value at prerender time can break out of the content attribute and inject HTML or JavaScript. The injected payload executes in the browser context of any user visiting the prerendered page. The vulnerability is tracked under CWE-79.
Critical Impact
Attackers who control cache-control values during prerendering can execute arbitrary JavaScript in visitors' browsers, enabling session theft, credential harvesting, and site defacement.
Affected Products
- SvelteKit (@sveltejs/kit) versions before 3.0.0
- Applications using SvelteKit prerendering with setHeaders for cache-control
- Static sites generated by vulnerable SvelteKit versions
Discovery Timeline
- 2026-10-21 - CVE-2026-114061 published to NVD
- 2026-10-22 - Last updated in NVD database
Technical Details for CVE-2026-114061
Vulnerability Analysis
SvelteKit supports prerendering pages at build time and allows route handlers to set HTTP headers through the setHeaders function. When a page is prerendered, SvelteKit embeds the resulting cache-control value into the static HTML as a <meta http-equiv="cache-control" content="..."> tag so the directive persists when the page is served from a static host.
The framework inserts the cache-control string directly into the content attribute without HTML-encoding quotes, angle brackets, or other reserved characters. An attacker who can influence the cache-control value, for example via a parameter consumed during prerendering, can break out of the attribute with a double quote and append arbitrary HTML.
The injected markup becomes part of the generated static page. Every visitor loads the attacker-controlled payload, which executes with the full privileges of the application origin, including access to cookies, local storage, and same-origin APIs.
Root Cause
The root cause is missing output encoding when serializing a server-controlled header value into HTML. The code path trusted the cache-control string as a safe directive and did not apply attribute-context escaping. See the GitHub Security Advisory GHSA-27mw-82g8-phjj for the maintainer analysis.
Attack Vector
Exploitation requires an attacker to influence the cache-control value processed by setHeaders during prerender. This typically means a prerendered route that derives header values from external data, request parameters, or CMS content. The attacker supplies a crafted string containing "> followed by HTML or script content. User interaction, specifically visiting the prerendered page, is required to trigger execution. See the VulnCheck advisory for additional context.
No verified public exploit code is available at the time of writing.
Detection Methods for CVE-2026-114061
Indicators of Compromise
- Prerendered HTML files containing <meta http-equiv="cache-control"> tags with unexpected characters such as ">, <script, or onerror= inside the content attribute
- Unexpected outbound requests from visitor browsers to attacker-controlled domains after loading prerendered pages
- Browser console errors or Content Security Policy violations originating from prerendered routes
Detection Strategies
- Scan the build output directory for <meta http-equiv="cache-control" occurrences and inspect content attribute values for non-directive characters
- Audit SvelteKit route handlers for calls to setHeaders that pass untrusted or dynamic values as the cache-control directive
- Add Content Security Policy headers to prerendered pages and monitor report-uri or report-to endpoints for inline-script violations
Monitoring Recommendations
- Log and alert on CI/CD builds that produce HTML containing script tags in meta elements
- Monitor web analytics and error-tracking telemetry for anomalous JavaScript errors on prerendered routes
- Track the installed @sveltejs/kit version across repositories using software composition analysis
How to Mitigate CVE-2026-114061
Immediate Actions Required
- Upgrade @sveltejs/kit to version 3.0.0 or later in all affected projects
- Rebuild and redeploy all prerendered sites after upgrading to purge any poisoned static HTML
- Review every call to setHeaders and remove dynamic or user-influenced cache-control values
- Validate that cache-control strings conform to the RFC 7234 grammar before passing them to setHeaders
Patch Information
The maintainers fixed the issue in SvelteKit 3.0.0 by escaping the cache-control value before inserting it into the meta tag. Full remediation details are documented in GitHub Security Advisory GHSA-27mw-82g8-phjj. Teams unable to upgrade immediately should audit prerendered output and remove dynamic cache-control inputs.
Workarounds
- Hardcode cache-control strings in route handlers rather than deriving them from external input
- Strip or reject characters such as ", <, and > from any value passed to setHeaders('cache-control', ...)
- Deploy a strict Content Security Policy that blocks inline scripts on prerendered routes until the upgrade is complete
# Upgrade SvelteKit to the patched release
npm install @sveltejs/kit@^3.0.0
npm run build
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

