An XSS vulnerability exists in Svelte 5.46.0-2 resulting from improper escaping of hydratable keys. If these keys incorporate untrusted user input, arbitrary JavaScript can be injected into server-rendered HTML.
When using the <code>hydratable</code> function, the first argument is used as a key to uniquely identify the data, such that the value is not regenerated in the browser.
This key is embedded into a <script> block in the server-rendered <head> without escaping unsafe characters. A malicious key can break out of the script context and inject arbitrary JavaScript into the HTML response.
This is a cross-site scripting vulnerability affecting applications that have the experimental.async flag enabled and use hydratable with keys incorporating untrusted user input.
Affected applications should upgrade to a patched version immediately.
{
"cwe_ids": [
"CWE-79"
],
"severity": "MODERATE",
"nvd_published_at": "2026-01-15T20:16:03Z",
"github_reviewed": true,
"github_reviewed_at": "2026-01-15T20:13:33Z"
}