Svelte 1.17.0 and 1.16.0 are versions of the Svelte compiler, a framework lauded for its "disappearing" nature – it compiles your code to highly efficient vanilla JavaScript during the build process, resulting in smaller bundle sizes and improved runtime performance compared to traditional virtual DOM frameworks. The core description and foundational principles of Svelte remain consistent between these versions, focusing on developer productivity and optimal user experience.
A key area of interest for developers lies in examining the devDependencies. Checking the package.json of the packages allows one to confirm that the listed devDependencies sections appear to be identical between versions 1.16.0 and 1.17.0. This suggests that the toolchain and testing environment used for developing Svelte remained largely unchanged during this incremental update. Developers can infer underlying updates and bug fixes in the core compiler logic are the primary focus of version bump, rather than major shifts in tooling or supported features.
For developers already using Svelte, upgrading from 1.16.0 to 1.17.0 likely involved minimal breaking changes, encouraging a smooth transition and continued use of the framework. The update presumably addresses subtle performance enhancements, bug fixes, or refinements to the compiler, all contributing to a more robust and polished development experience. It reinforced Svelte's commitment to providing a lean and high-performing solution for building modern web applications and UI components, empowering developers to create exceptional user interfaces with ease.
All the vulnerabilities related to the version 1.17.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