Svelte version 1.51.0, released on January 6, 2018, follows closely on the heels of version 1.50.1, which was released just a few days prior on January 2, 2018. While both versions share the same core description as "The magical disappearing UI framework," the subtle version bump hints at bug fixes and minor enhancements rather than groundbreaking new features. For developers already using Svelte, this incremental update suggests a safe and worthwhile upgrade to leverage any improvements and stability enhancements made in the intervening days.
Examining the devDependencies section reveals an identical setup between the two versions. This indicates the development environment and tooling remained consistent, suggesting the team focused on internal refactoring or addressing existing issues without introducing significant build process changes. Therefore, developers updating from 1.50.1 won't face any compatibility issues with their existing development pipelines. The shared dependency versions for tools like rollup, typescript, and eslint further reinforce this stability.
For those new to Svelte, these versions represent a mature and actively maintained framework suitable for building performant web applications. Svelte differentiates itself by compiling components to highly optimized vanilla JavaScript during build time, leading to smaller bundle sizes and better runtime performance compared to traditional frameworks. The quick release cycle between 1.50.1 and 1.51.0 demonstrates the project's commitment to rapid iteration and addressing user feedback.
All the vulnerabilities related to the version 1.51.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