Svelte 3.32.1 arrives as a minor version update following closely on the heels of 3.32.0, both versions continuing to deliver on the promise of "Cybernetically enhanced web apps." A quick comparison shows the dependencies remain identical between these two releases, suggesting that the changes are internal rather than a result of dependency upgrades. Intriguingly, the unpacked size has slightly increased from 6355345 bytes in 3.32.0 to 6363485 bytes in 3.32.1. This increase, while seemingly small, could indicate bug fixes, performance enhancements, or small feature additions that don't warrant a major or minor version bump. Because these two versions are so similar, it is advisable to update to the latest one since it means it has the latest bug fixes or small improvements. Svelte remains a compelling choice for developers looking for a component-based JavaScript framework that shifts the workload from the browser to the compile step, resulting in highly performant and efficient web applications. These versions leverage a rich set of devDependencies, including tools like Rollup for bundling, Typescript for type-safe development, ESLint for code linting, and a comprehensive suite of testing tools, ensuring a robust development experience. The continued use of these dependencies signifies the ongoing commitment to a modern and well-supported development workflow within the Svelte ecosystem.
All the vulnerabilities related to the version 3.32.1 of the package
Svelte vulnerable to XSS when using objects during server-side rendering
The package svelte before 3.49.0 is vulnerable to Cross-site Scripting (XSS) due to improper input sanitization and to improper escape of attributes when using objects during SSR (Server-Side Rendering). Exploiting this vulnerability is possible via objects with a custom toString() function.
Svelte has a potential mXSS vulnerability due to improper HTML escaping
A potential XSS vulnerability exists in Svelte for versions prior to 4.2.19.
Svelte improperly escapes HTML on server-side rendering. It converts strings according to the following rules:
"
-> "
&
-> &
<
-> <
&
-> &
The assumption is that attributes will always stay as such, but in some situation the final DOM tree rendered on browsers is different from what Svelte expects on server-side rendering. This may be leveraged to perform XSS attacks. More specifically, this can occur when injecting malicious content into an attribute within a <noscript>
tag.
A vulnerable page (+page.svelte
):
<script>
import { page } from "$app/stores"
// user input
let href = $page.url.searchParams.get("href") ?? "https://example.com";
</script>
<noscript>
<a href={href}>test</a>
</noscript>
If a user accesses the following URL,
http://localhost:4173/?href=</noscript><script>alert(123)</script>
then, alert(123)
will be executed.
XSS, when using an attribute within a noscript tag