Svelte version 1.58.5 is a minor update following version 1.58.4 in the 1.x series of this "magical disappearing UI framework." Both versions share the same core description, indicating a focus on compiling components to highly efficient vanilla JavaScript during build time, leading to excellent runtime performance. They also maintain the same MIT license, author (Rich Harris), and repository, signaling a consistent commitment to open-source principles and ongoing development.
The key difference lies in the release date, with v1.58.5 being published on March 29, 2018, slightly after v1.58.4 which was released on March 28, 2018. This suggests that version 1.58.5 likely contains bug fixes, minor enhancements, or very specific optimizations introduced after the previous release. This is also confirmed by the different unpackedSize of the packages: 2327569 vs 2326259 (1.58.5 vs 1.58.4).
For developers considering Svelte, both versions offer a similar development experience, leveraging a comprehensive suite of development dependencies for tasks such as linting (eslint), testing (mocha, jsdom), code transformation (rollup, typescript), and more. These tools ensure code quality, facilitate debugging, and streamline the build process. While the differences between these specific versions are likely incremental, staying up-to-date with the latest minor releases is generally recommended to benefit from the latest bug fixes and performance improvements, ensuring a more robust and performant application.
All the vulnerabilities related to the version 1.58.5 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