Packages / @sveltejs/kit / Security

LowVulnerabilityGHSA-27mw-82g8-phjjCVE-2026-114061Published 23 Oct 2026

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

Affected releases · @sveltejs/kit

  • 2.x2.0.0 – 2.70.3No fix on this line yet
  • 1.x and older0.0.8 – 1.30.4No fix, no longer updated

2.x has no fix yet; the newest fixed line:

npm install @sveltejs/kit@3.0.0
3.x
  1. Not affected

    3.0.0 – 3.1.0

    3 releases, latest

2.x
  1. Affected

    2.0.0 – 2.70.3

    237 releases

1.x
  1. Affected

    1.0.0 – 1.30.4

    128 releases

0.x
  1. Affected

    0.0.8 – 0.0.30

    21 releases

389 stable releases of @sveltejs/kit, oldest to newest, one row per major.

Is your project affected?

Paste your package.json, or type the range you declare for @sveltejs/kit. It is read in your browser and sent nowhere.

What happens

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.