Svelte 3.19.2 is a minor patch release following 3.19.1 in the Svelte 3 series, a popular JavaScript compiler that transforms declarative components into highly efficient vanilla JavaScript. Both versions share the same core development dependencies, including tools for testing (mocha, jsdom, c8), linting (eslint), bundling (rollup), and TypeScript support. This ensures a consistent development experience for contributors and users alike.
The key difference between the two versions lies in their release dates and potentially bug fixes or small internal improvements. 3.19.2 was released on March 5th, 2020, approximately ten days after 3.19.1, which was released on February 23rd, 2020. Developers choosing between the two should opt for 3.19.2 as it likely incorporates the latest stability and performance enhancements addressed since the prior release. There is also a minimal difference on fileCount and unpackedSize, which would also indicate code changes. Svelte's approach ensures your applications are fast and lightweight, offering reactive updates and a simplified component structure. Svelte has gained traction in the web development community because it allows developers to write less code while achieving greater performance. Its compiler-based approach reduces the amount of JavaScript shipped to the browser, leading to faster load times and improved user experience.
All the vulnerabilities related to the version 3.19.2 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