Svelte version 2.8.1 is a minor patch release following closely on the heels of version 2.8.0 in the Svelte UI framework ecosystem. Both versions share identical development dependencies indicating a focus on stability and the toolchain used for building and testing the library itself. Key dependencies like Rollup for bundling, ESLint for linting, and TypeScript for type checking remain consistent, ensuring a familiar environment for contributors and maintainers.
The primary difference appears in the dist object. While both versions contain 15 files, the unpacked size of 2.8.1 is slightly larger at 2,568,357 bytes compared to 2.8.0's 2,568,154 bytes. This suggests that the patch likely addressed a minor bug fix or a small performance improvement that resulted in a minimal increase in the overall size of the distribution.
For developers using Svelte, the upgrade from 2.8.0 to 2.8.1 should be seamless. The unchanged development dependencies mean no compatibility issues are expected with existing build processes or tooling. The patch likely resolves a niche issue identified in 2.8.0, making 2.8.1 the preferred version for new and existing projects alike, ensuring access to the latest improvements and bug fixes. Given the minimal size difference and rapid release cycle, it's a good practice to stay up-to-date with these minor releases to leverage the continuous enhancements from the Svelte team. The release date also shows a quick turnaround time, indicating an active development cycle and prompt attention to reported issues.
All the vulnerabilities related to the version 2.8.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