# CVE-2026-27121: Svelte cross-site scripting in server-side rendering via spread attributes

Source: https://junglewise.ai/threats/cve-2026-27121-svelte-cross-site-scripting-in-server-side-rendering-via-spread  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-02-19. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-27121 · Severity: medium · CVSS 4 · Published 2026-02-19

Svelte is a popular JavaScript framework used to build web applications. During server-side rendering, Svelte incorrectly processes spread syntax when used with untrusted data, allowing attackers to inject malicious event handlers into HTML output. These injected handlers execute in users' browsers, potentially stealing session tokens, credentials, or sensitive data from the page.

Technologies: [svelte (npm)](https://junglewise.ai/threats/technologies/svelte). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2026-27121 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-27121 being exploited in the wild.

**How severe is CVE-2026-27121?** Medium severity, with a CVSS score of 4, published 19 February 2026.

**Which products and versions are affected?** svelte (npm) SEMVER:introduced=0,fixed=5.51.5.

**Is there a fix for CVE-2026-27121?** Yes. svelte (npm): upgrade to 5.51.5 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-27121 attacked?** It is attacked over the network.

**Am I affected by CVE-2026-27121?** 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.51.5 or later

  ```sh
  npm install svelte@5.51.5
  ```


## Technical details

The vulnerability is a cross-site scripting (CWE-79) flaw in Svelte versions prior to 5.51.5. When using spread syntax to render HTML element attributes from untrusted or user-controlled data during server-side rendering, event handler properties are not properly filtered and are included in the rendered HTML output. An attacker who can control data being spread as attributes (such as URL parameters, form inputs, or external API responses) can inject properties like `onload`, `onerror`, or `onmouseover` with malicious JavaScript code. The attack requires network access and high privileges (to submit untrusted data) with high attack complexity, but success results in client-side code execution in victim browsers. The fix is available in version 5.51.5 and later.

## Affected products

- Svelte Svelte <=5.51.4

## Identifiers

- CVE-2026-27121
- GHSA-f7gr-6p89-r883

## Timeline

- 2026-02-19: disclosed
- 2026-02-19: patched: Fixed in version 5.51.5

## References

- [https://github.com/sveltejs/svelte/security/advisories/GHSA-f7gr-6p89-r883](https://github.com/sveltejs/svelte/security/advisories/GHSA-f7gr-6p89-r883)

## Related threats

- [Svelte XSS via spread attributes in SSR](https://junglewise.ai/threats/cve-2026-42599-svelte-xss-via-spread-attributes-in-ssr)
- [Svelte DOM clobbering leading to XSS in internal framework state](https://junglewise.ai/threats/cve-2026-42573-svelte-dom-clobbering-leading-to-xss-in-internal-framework-state)
- [Svelte ReDoS in svelte:element tag validation](https://junglewise.ai/threats/cve-2026-42567-svelte-redos-in-svelte-element-tag-validation)
- [Svelte XSS via insecure promise serialization in hydratable](https://junglewise.ai/threats/svelte-xss-via-insecure-promise-serialization-in-hydratable-3f504409)
- [Svelte XSS via HTML comment injection in SSR error boundary](https://junglewise.ai/threats/cve-2026-27902-svelte-xss-via-html-comment-injection-in-ssr-error-boundary)
