CVE-2026-27902: Svelte XSS via HTML comment injection in SSR error boundary

CVE-2026-27902 · Severity: medium · CVSS 4 · Published 2026-02-26

Svelte is a popular JavaScript framework for building web applications. A vulnerability in server-side rendering (SSR) error handling allows attackers to inject malicious HTML and JavaScript code through error messages that are not properly escaped before being embedded in web pages. This could enable attackers to steal user credentials, session tokens, or sensitive data from visitors to affected applications.

Technologies: svelte (npm). Vendors: npm.

Quick answers

Is CVE-2026-27902 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-27902 being exploited in the wild.
How severe is CVE-2026-27902?
Medium severity, with a CVSS score of 4, published 26 February 2026.
Which products and versions are affected?
svelte (npm) SEMVER:introduced=5.53.0,fixed=5.53.5.
Is there a fix for CVE-2026-27902?
Yes. svelte (npm): upgrade to 5.53.5 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-27902 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-27902?
Check whether you run svelte (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • svelte (npm): upgrade to 5.53.5 or later
    npm install svelte@5.53.5

Technical details

The vulnerability is a cross-site scripting (XSS) flaw in Svelte's error boundary hydration markers used during server-side rendering. The root cause is improper escaping of error messages from the transformError function before they are embedded into HTML output. An attacker who can control the content returned by transformError can inject arbitrary HTML and JavaScript that will execute in users' browsers. The attack requires network access and specific conditions to exploit (high attack complexity and attack requirements present), but does not require authentication or elevated privileges. Affected versions range from 5.53.0 to 5.53.4; the fix is available in version 5.53.5.

Affected products

  • Svelte Svelte 5.53.0 to 5.53.4

Identifiers

  • CVE-2026-27902
  • GHSA-qgvg-pr8v-6rr3

Timeline

  • 2026-02-26: disclosed
  • 2026-02-26: patched: Fixed in version 5.53.5

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.