Svelte versions 2.9.7 and 2.9.8, both described as "the magical disappearing UI framework," are very similar, with only minor differences that might be of interest to developers. Both versions retain the MIT license and are authored by Rich Harris, demonstrating a consistent commitment to open-source principles and reliable authorship. The core development dependencies remain identical, indicating a shared build process and tooling environment. This includes crucial tools like Rollup for bundling, TypeScript for type checking, and ESLint for code quality, ensuring a stable and well-maintained development experience.
The primary difference lies in the dist section, specifically the unpackedSize and releaseDate. Version 2.9.8 has an unpacked size of 2604457 bytes and was released on August 1, 2018, while version 2.9.7 has an unpacked size of 2599102 bytes and was released on July 24, 2018. This small size difference likely signifies bug fixes, minor performance improvements, or other small internal code changes. Although the file count remains consistent for both versions to 17, it underscores that the changes did not introduce or remove any files. Developers should upgrade to version 2.9.8 if any known bugs from 2.9.7 were addressed in these internal changes to benefit from any potential stability and/or performance improvements. This update provides a small improvement opportunity for developers seeking a more polished and up-to-date experience.
All the vulnerabilities related to the version 2.9.8 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