Svelte 5.46.0 - Hydratable Key Script-Breakout XSS (SSR)

5.3

Medium

5.3

Medium

Discovered by

Camilo Vera

Offensive Team, Fluid Attacks

Summary

Full name

Svelte 5.46.0 - Hydratable Key Script-Breakout XSS (SSR)

Code name

State

Public

Release date

Jan 15, 2026

Affected product

svelte

Vendor

sveltejs

Affected version(s)

>=5.46.0, <=5.46.3

Fixed version(s)

5.46.4

Package manager

npm

Vulnerability name

Reflected cross-site scripting (XSS)

Remotely exploitable

Yes

CVSS v4.0 vector string

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

CVSS v4.0 base score

5.3

Exploit available

No

Description

An SSR XSS exists in async hydration when attacker‑controlled keys are passed to hydratable. The key is embedded inside a <script> block without HTML‑safe escaping, allowing </script> to terminate the script and inject arbitrary JavaScript. This enables remote script execution in users' browsers, with potential for session theft and account compromise.

Vulnerability

The vulnerability arises when hydratable(key, fn) accepts untrusted keys, which are then serialized into a <script> block in the server-rendered head without escaping unsafe characters. A malicious key containing </script> breaks out of the script context and injects arbitrary JavaScript into the HTML response.

  • File: packages/svelte/src/internal/server/renderer.js

  • Function: Renderer.#hydratable_block(ctx)

  • Sink: inline <script> payload that sets window.__svelte.h map.

entries.push(`[${JSON.stringify(k)},${v.serialized}]`);

JSON.stringify does not escape <, so a key containing </script> terminates the <script> tag.

Evidence of Exploitation

Our security policy

We have reserved the ID CVE-2025-15265 to refer to this issue from now on.

Disclosure policy

System Information

  • Svelte

  • Version >=5.46.0, <=5.46.3

  • Operating System: Any

References

Mitigation

An updated version of Svelte is available at the vendor page.

Credits

The vulnerability was discovered by Camilo Vera from Fluid Attacks' Offensive Team.

Timeline

Dec 27, 2025

Vulnerability discovered

Dec 29, 2025

Vendor contacted

Jan 5, 2026

Vendor replied

Jan 5, 2026

Vendor confirmed

Jan 15, 2026

Vulnerability patched

Jan 15, 2026

Public disclosure

Does your application use this vulnerable software?

During our free trial, our tools assess your application, identify vulnerabilities, and provide recommendations for their remediation.

Fluid Attacks' solutions enable organizations to identify, prioritize, and remediate vulnerabilities in their software throughout the SDLC. Supported by AI, automated tools, and pentesters, Fluid Attacks accelerates companies' risk exposure mitigation and strengthens their cybersecurity posture.

Get an AI summary of Fluid Attacks

Subscribe to our newsletter

Stay updated on our upcoming events and latest blog posts, advisories and other engaging resources.

© 2026 Fluid Attacks. We hack your software.

Fluid Attacks' solutions enable organizations to identify, prioritize, and remediate vulnerabilities in their software throughout the SDLC. Supported by AI, automated tools, and pentesters, Fluid Attacks accelerates companies' risk exposure mitigation and strengthens their cybersecurity posture.

Subscribe to our newsletter

Stay updated on our upcoming events and latest blog posts, advisories and other engaging resources.

Get an AI summary of Fluid Attacks

© 2026 Fluid Attacks. We hack your software.

Fluid Attacks' solutions enable organizations to identify, prioritize, and remediate vulnerabilities in their software throughout the SDLC. Supported by AI, automated tools, and pentesters, Fluid Attacks accelerates companies' risk exposure mitigation and strengthens their cybersecurity posture.

Subscribe to our newsletter

Stay updated on our upcoming events and latest blog posts, advisories and other engaging resources.

Get an AI summary of Fluid Attacks

© 2026 Fluid Attacks. We hack your software.