CVE-2026-42573: Svelte Vulnerable to XSS via DOM Clobbering of Internal Framework State

svelte Updated 14 May 2026

Summary

14/05/2026
Yes i
Moderate
5.3

CVE-2026-42573: Svelte Vulnerable to XSS via DOM Clobbering of Internal Framework State. Affects svelte versions < 5.55.7. Fixed in 5.55.7. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Svelte is a modern JavaScript framework used for building user interfaces. It compiles components into highly efficient JavaScript code, enabling developers to create reactive applications with minimal overhead. However, Svelte has a vulnerability related to DOM clobbering, which can lead to cross-site scripting (XSS) attacks if not addressed properly.

Vulnerability Detail

The vulnerability arises from the use of attribute spreading on form elements in Svelte. If both the form element and its input or button children allow user-controlled dynamic values for the 'name' attribute, an attacker can manipulate the internal state of the framework. This manipulation can lead to XSS attacks, where malicious scripts are executed in the context of the user's browser, potentially compromising sensitive data.

How To Fix

Latest published version: 5.57.2 as of 23 Oct 2026

npm install svelte@5.57.2

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

5.55.7

This is the first release that contains the fix.

npm install svelte@5.55.7

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid using attribute spreading on form elements or ensure that the 'name' attribute on input or button elements is not user-controllable. For example, instead of using dynamic values, hard-code the 'name' attribute as follows: <form><input name='fixedName'></form>

Conclusion

The vulnerability identified as CVE-2026-42573 in the Svelte framework poses a risk of XSS attacks through DOM clobbering. It is crucial for developers using Svelte to update to the patched version 5.55.7 or later to mitigate this risk. Additionally, implementing workarounds can help reduce exposure until the update is applied.

See every vulnerability recorded for svelte →

Share this vulnerability

FAQ

DOM clobbering is a technique where an attacker can overwrite existing properties or methods in the Document Object Model (DOM) by manipulating element attributes, potentially leading to security vulnerabilities.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

XSS attacks can lead to unauthorized access to user data, session hijacking, and the execution of malicious scripts in the context of the user's browser, posing significant security risks.

Yes, Vulert can monitor and alert you in real-time for open-source vulnerabilities in your software using just the package-lock.json file.

The CVSS score of this vulnerability is 5.3, indicating a moderate severity level.

Related vulnerabilities

Recent vulnerabilities recorded for svelte.

How To Fix

Latest published version: 5.57.2 as of 23 Oct 2026

npm install svelte@5.57.2

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

5.55.7

This is the first release that contains the fix.

npm install svelte@5.55.7

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback