Svelte 2.9.1 is a minor patch release of the Svelte JavaScript framework, building upon the foundation laid by version 2.9.0. Both versions share the same core description: "The magical disappearing UI framework," highlighting Svelte's key feature of compiling components into highly efficient vanilla JavaScript during the build process, leading to smaller bundle sizes and improved runtime performance compared to traditional virtual DOM frameworks.
While the developer dependencies remain identical between the two versions, encompassing essential tools like Rollup, Typescript, and ESLint, the most notable difference lies in the releaseDate. Svelte 2.9.1 was published on July 1, 2018, a couple of days after Svelte 2.9.0, released on June 29, 2018. The unpackedSize is also very close, with a minor difference of 7 bytes. This suggests that the update likely addresses bug fixes, performance tweaks, or minor adjustments rather than introducing significant new features or API changes.
For developers, this means that upgrading from 2.9.0 to 2.9.1 should be a relatively straightforward process with minimal risk of introducing breaking changes. It's always advisable to review the changelog for specific details on the changes implemented in the patch release, but generally, this type of update focuses on improving stability and addressing potential issues encountered by users of the previous version. These minor releases play a vital role to keep the project up to date and trustworthy.
All the vulnerabilities related to the version 2.9.1 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