Svelte version 1.42.0 arrived on November 21, 2017, quickly following version 1.41.4 released just a few days earlier on November 18, 2017. Both versions maintain the core promise of Svelte: "The magical disappearing UI framework," emphasizing its compile-time nature that leads to highly optimized and performant JavaScript code. A detailed dependency comparison reveals no differences in the devDependencies listed between these two versions. Both rely on the same versions of essential tools like rollup, typescript, various eslint plugins, and other utilities vital for development, testing, and bundling.
Essentially, the upgrade from 1.41.4 to 1.42.0 doesn't introduce changes tied to the listed development dependencies. Thus, the update most likely includes internal bug fixes, performance enhancements, or minor feature tweaks within the Svelte compiler itself. These changes are transparent from the dependency manifest but could nonetheless improve the developer experience or application efficiency. Developers upgrading should note that while the tooling environment remains the same, it's generally advisable to review Svelte's release notes or changelogs for specifics regarding fixes, optimizations, or new capabilities delivered by this incremental release. This highlights Svelte's active development and commitment to refining its core functionality for building reactive web applications.
All the vulnerabilities related to the version 1.42.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