Packages / svelte / Security

ModerateVulnerabilityGHSA-rcqx-6q8c-2c42CVE-2026-42573Published 14 May 2026

Svelte Vulnerable to XSS via DOM Clobbering of Internal Framework State

Affected releases · svelte

  • 5.x5.0.0 – 5.55.6Fixed in 5.55.7
  • 4.x and older0.0.1 – 4.2.20No fix, no longer updated

On 5.x, the newest line:

npm install svelte@5.55.7
5.x
  1. Affected

    5.0.0 – 5.55.6

    325 releases

  2. Fixed

    5.55.7 – 5.57.2

    18 releases, latest

4.x
  1. Affected

    4.0.0 – 4.2.20

    30 releases

3.x
  1. Affected

    3.0.0 – 3.59.2

    152 releases

2.x
  1. Affected

    2.0.0 – 2.16.1

    57 releases

1.x
  1. Affected

    1.0.0 – 1.64.1

    178 releases

0.x
  1. Affected

    0.0.1 – 0.3.0

    8 releases

768 stable releases of svelte, oldest to newest, one row per major.

Is your project affected?

Paste your package.json, or type the range you declare for svelte. It is read in your browser and sent nowhere.

What happens

Svelte was vulnerable to DOM clobbering of its internal framework state on elements, potentially leading to XSS attacks.

You are vulnerable if all of the following is true:

  • you are using attribute spreading on a form element

  • you are using attribute spreading or allow a dynamic value for the name attribute on an input or button element within that form

  • both of these are simultaneously user-controllable

<form {...spread1}>
  <input {...spread2}>
</form>