Svelte 3.17.0 builds upon the solid foundation of Svelte 3.16.7, offering developers the same cybernetically enhanced web app experience but with updated tooling. One notable change lies in the development dependencies: Svelte 3.17.0 embraces the official rollup plugins using the @rollup scope which receive more active maintenance, like @rollup/plugin-json at version ^4.0.1, @rollup/plugin-replace at ^2.3.0, @rollup/plugin-sucrase at ^3.0.0, @rollup/plugin-virtual at ^2.0.0, @rollup/plugin-commonjs at ^11.0.0, @rollup/plugin-typescript at ^2.0.1 and @rollup/plugin-node-resolve at ^6.0.0 , while the older version used community rollup plugins like rollup-plugin-json, rollup-plugin-sucrase, rollup-plugin-virtual, rollup-plugin-commonjs, rollup-plugin-typescript and rollup-plugin-node-resolve. This shift towards official plugins promises better long-term support and compatibility, ensuring smoother build processes and reducing potential integration headaches.
Furthermore, Svelte 3.17.0 features an updated Rollup version at ^1.27.14, compared to ^1.21.4 in Svelte 3.16.7, bringing performance improvements and bug fixes inherent in the newer Rollup release.
For developers, this translates to a more streamlined and reliable development workflow. Upgrading to Svelte 3.17.0 ensures you're leveraging the latest tooling advancements, offering improved build performance with updated rollup and better maintainability using official rollup plugins, ultimately contributing to a more robust and future-proof Svelte application. The core Svelte experience remains consistent, focusing on writing concise, declarative components that compile to highly efficient vanilla JavaScript.
All the vulnerabilities related to the version 3.17.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