---
id: "CVE-2026-114061"
kind: "vulnerability"
aliases: ["CVE-2026-114061", "GHSA-27mw-82g8-phjj"]
title: "SvelteKit : XSS via untrusted cache-control header in prerendered page"
severity: "medium"
cvss: 4.7
epss: 0.00174
exploited: false
status: "open"
category: "package"
products: [{"name": "@sveltejs/kit", "fixed": ["3.0.0"], "affected": "< 3.0.0", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["cwe-79", "next.js", "npm", "package", "prerendered-sites", "sveltekit"]
not_affected_if: ["no-setheaders-usage", "static-export-with-fixed-headers", "untrusted-input-not-used"]
published_at: "2026-10-21T01:17:29+00:00"
first_seen_at: "2026-10-23T20:45:22+00:00"
updated_at: "2026-10-23T21:57:27+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-27mw-82g8-phjj", "first_seen_at": "2026-10-23T20:45:22+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-114061", "first_seen_at": "2026-10-23T21:57:27+00:00"}]
---

# SvelteKit : XSS via untrusted cache-control header in prerendered page

SvelteKit prerendered pages put a cache-control header value into a meta tag without escaping it when the app sets that header from untrusted input via setHeaders. An attacker who controls that value at prerender time can inject HTML or JavaScript that runs for visitors of the generated page.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:@sveltejs/kit affected < 3.0.0 fixed 3.0.0

## How to check

Search the app for setHeaders calls that set cache-control from request data, query params, or other untrusted sources on pages that are prerendered.

## Fix

Upgrade @sveltejs/kit to 3.0.0 or later.
Until then, stop forwarding untrusted cache-control values with setHeaders on prerendered pages and use a fixed cache policy.

## Timeline

- 2026-10-23T20:45:22+00:00 ghsa https://github.com/advisories/GHSA-27mw-82g8-phjj
- 2026-10-23T21:57:27+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-114061

## From the sources

### Impact

Applications that prerender pages and use `setHeaders` to set a `cache-control` header from an untrusted source are vulnerable to cross-site scripting (XSS).

SvelteKit inserts the header value into a `<meta http-equiv="cache-control">` tag without escaping it. An attacker who can influence this value at prerender time can break out of the `content` attribute and inject HTML or JavaScript into the generated page. The injected code can then execute when users visit the page.

### Patches

The fix escapes the header value before inserting it into the generated HTML. Upgrade to `@sveltejs/kit` version 3.0.0 or later.

### Workarounds

Avoid forwarding untrusted `cache-control` header values with `setHeaders` on prerendered pages. Use a fixed, trusted cache policy instead.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
