Svelte 3.43.0 represents a minor version update to the popular JavaScript framework, succeeding version 3.42.6. While both share the same core description of "Cybernetically enhanced web apps," a key difference lies in their release date, with 3.43.0 being released approximately one week after 3.42.6, on September 22, 2021. Developers will appreciate that both versions include a robust set of devDependencies aimed at streamlining the development process, promoting code quality and facilitating testing. These include tools like eslint for linting, rollup for bundling, typescript for static type checking, and mocha for testing. The configuration for Svelte specific linting with @sveltejs/eslint-config remains consistent using version v5.7.0. The unpacked size of 3.43.0 is marginally larger than 3.42.6, suggesting potential bug fixes, performance improvements, or minor feature additions. For developers, this update highlights Svelte's commitment to continuous improvement of the developer experience and performance. Considering the minimal changes in devDependencies, existing Svelte projects are likely to upgrade seamlessly, giving them access to the latest enhancements and possibly addressing discovered issues from the preceding week. Always consult Svelte's official changelog for exhaustive details on precise updates, bug resolutions and feature additions.
All the vulnerabilities related to the version 3.43.0 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