Svelte is a UI framework known for its "disappearing" nature, compiling components into highly efficient vanilla JavaScript during build time, resulting in exceptional runtime performance. Comparing versions 1.10.0 and 1.9.1, developers will find that the core dependencies remain largely consistent, with magic-string powering source code manipulation. Both versions share an identical set of development dependencies, indicating a stability in the build and testing pipeline. Key tools like rollup for bundling, eslint for linting, mocha for testing, and nyc for code coverage are all present, suggesting a robust development environment is maintained across both releases. This consistency offers assurance to developers relying on these tools for their Svelte projects.
The primary difference appears to be the release date, with version 1.10.0 released on March 4, 2017, a couple of days after version 1.9.1. This increment suggests bug fixes, minor enhancements, or internal improvements rather than sweeping architectural changes. Developers considering upgrading from 1.9.1 to 1.10.0 should anticipate a smooth transition, as the identical dependency lists indicate a high degree of backward compatibility. For projects already using Svelte, staying up-to-date ensures access to the latest stability improvements and potentially minor performance gains, all while minimizing disruption to workflows. Developers can expect a consistent and reliable experience across both versions, thanks to the solid foundation of build tools and testing frameworks.
All the vulnerabilities related to the version 1.10.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