Svelte 1.28.0 represents an incremental update over version 1.27.0, refining the developer experience and build process of this "magical disappearing UI framework." A key distinction lies in the updated dependencies, offering a more modern toolchain for Svelte development. Notably, nyc is bumped from version 10.0.0 to 11.1.0, while acorn jumps from 4.0.4 to 5.1.1, demonstrating a commitment to incorporating the latest advancements in JavaScript parsing.
Rollup, the bundler, sees an upgrade from 0.43.0 to 0.45.2, suggesting potential improvements in build performance and module handling. The update of @types/node from 7.0.22 to 8.0.17 indicates enhanced TypeScript support, potentially simplifying the development of type-safe Svelte components. A shift away from Babel is noticeable with the removal of babel dependencies, streamlining the build process and potentially improving performance through the usage of more modern alternatives like Typescript directly during the build. This contributes to Svelte's core philosophy of minimal overhead and maximum performance, compiling away during the build process to produce highly optimized JavaScript. The move towards newer versions of development dependencies hints at increased stability and improved tooling for Svelte developers.
All the vulnerabilities related to the version 1.28.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