
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-27902 is a Cross-Site Scripting (XSS) vulnerability in the Svelte performance-oriented web framework, specifically affecting its Server-Side Rendering (SSR) error boundary hydration markers. Prior to version 5.53.5, errors returned from the transformError function were not correctly escaped before being embedded in HTML output as hydration comments, enabling HTML injection and XSS if attacker-controlled content flows through transformError. The vulnerability affects Svelte versions 5.53.0 through 5.53.4 (inclusive) for Node.js. It was published on February 25–26, 2026, with a fix released the same day. The CVSS v4 base score is 5.3 (Medium) (Github Advisory, Svelte Advisory).
The root cause is CWE-79 (Improper Neutralization of Input During Web Page Generation — Cross-site Scripting). During SSR, Svelte embeds error data from transformError as JSON inside HTML comments used as hydration boundary markers (e.g., <!--<svelte:boundary failed=...-->) without sanitizing special HTML comment sequences such as --> or --!>. An attacker who can control the content returned by transformError — for example, by injecting malicious input into an error message that propagates through the error transformation pipeline — can break out of the HTML comment context and inject arbitrary HTML or JavaScript. The fix, applied in commit 0298e97, introduces a #serialize_failed_boundary method that Unicode-escapes < characters in the JSON payload (e.g., --> becomes -->) to prevent comment breakout (Svelte Advisory, Fix Commit). Exploitation requires that the application passes attacker-influenced data into transformError and that a victim user loads the affected SSR-rendered page.
Successful exploitation allows an attacker to inject and execute arbitrary JavaScript in the context of a victim user's browser session on the affected Svelte application. This can lead to session hijacking, credential theft, malware distribution, or unauthorized actions performed on behalf of the victim. The CVSS v4 scoring reflects high subsequent-system confidentiality and integrity impact, indicating that downstream systems accessible via the user's session are also at risk (Github Advisory, Feedly). Availability is not directly impacted by this vulnerability.
There is no public proof-of-concept exploit and no evidence of in-the-wild exploitation as of the time of disclosure (Feedly). The EPSS score is approximately 0.034–0.045%, placing it in the lower percentiles for near-term exploitation likelihood (Github Advisory). The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires specific preconditions: the application must use Svelte's SSR error boundaries with a transformError function that processes attacker-controlled input, and a victim must load the resulting page.
transformError handler that incorporates user-supplied input into error messages.transformError, produces an error message containing HTML comment-breaking sequences such as --><img src=x onerror=alert(1)><!-- or --!><img src=x onerror=alert(1)><!--.transformError with the attacker-controlled content (e.g., via a search query or form field that is passed to a function that throws an error).-->, --!>) in query parameters or form fields; unexpected outbound connections from victim browsers to attacker-controlled domains following page load.-->, --!>, or <script patterns in inputs that flow into error-handling code; SSR rendering logs with unusual error messages containing HTML special characters.--> sequences within <!--<svelte:boundary hydration comments, or unexpected <img>, <script>, or event handler attributes appearing outside of comment boundaries in the page source.The primary remediation is to upgrade Svelte to version 5.53.5 or later, which sanitizes transformError output by Unicode-escaping < characters before embedding JSON in HTML hydration comments (Svelte Release, Fix Commit). No official workaround short of upgrading has been published; however, as an interim measure, developers should ensure that any custom transformError implementations sanitize or strip HTML special characters from error messages before returning them. Additionally, reviewing all error-handling code to prevent attacker-controlled data from reaching transformError output can reduce exposure (Github Advisory).
The vulnerability was reported and remediated by the Svelte security team, with credits to researcher elliott-with-the-longest-name-on-github (reporter), KarimPwnz (remediation developer), and maksyche (remediation reviewer) (Svelte Advisory). Red Hat tracked the issue via Bugzilla and assigned it medium priority/severity (Red Hat Bugzilla). The Svelte 5.53.5 release received positive community reactions on GitHub, with 10 users reacting favorably to the patch (Svelte Release). No significant broader media coverage or threat actor commentary has been observed.
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."