Svelte 3.2.2 represents a minor increment over version 3.2.1, both iterations of this popular JavaScript compiler prioritize streamlining web development with a cybernetically enhanced approach. While core functionalities remain consistent, subtle refinements and adjustments differentiate the two. Both versions share an identical set of dependencies, showcasing the stability and consistent tooling choices maintained by the Svelte team for development. This includes crucial libraries like rollup for bundling, typescript for type checking, and various eslint plugins for code quality.
The updated version 3.2.2 released on May 9, 2019, arrives just a few days after 3.2.1, suggesting a quick patch addressing specific bug fixes or minor improvements. The unpacked size has increased slightly, hinting at small additions. Developers considering upgrading should be aware of this size difference, while likely insignificant, could point to internal code adjustments. Given the closeness of release dates, the motivation is likely a hotfix. For those currently using 3.2.1, upgrading to 3.2.2 is recommended to take advantage of these potential bug fixes. Svelte's goal is to shift work away from the browser and into a compile step that efficiently updates the DOM. Both versions are licensed under the MIT license.
All the vulnerabilities related to the version 3.2.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