CVE-2026-42573: Svelte Vulnerable to XSS via DOM Clobbering of Internal Framework State
Summary
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 ↓
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.
No signup required · Results in about 60 seconds
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 →
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.
References
Related vulnerabilities
Recent vulnerabilities recorded for svelte.