Svelte version 2.16.0 is a minor update to the magical disappearing UI framework, building upon the foundations laid by version 2.15.3. Both versions share the same core description, "The magical disappearing UI framework," highlighting Svelte's innovative approach to web development where the framework's code transforms into highly optimized vanilla JavaScript during the build process, resulting in fast and performant applications.
A key aspect to note is the change in the release date from November 6, 2018, for version 2.15.3, to December 16, 2018, for version 2.16.0, indicating a little over a month of work and improvements between the two releases. From a developer's perspective, while the devDependencies remain identical, the updated release date suggests that version 2.16.0 likely includes bug fixes, performance enhancements, and potentially minor feature additions that were not present in the previous stable version. Furthermore, the unpackedSize has changed slightly, increasing from 967991 to 967999 bytes. This subtle difference can indicate internal code tweaks or optimizations.
For developers already using Svelte, upgrading to version 2.16.0 is recommended to benefit from these fixes and improvements. For new developers, starting with the latest stable version (2.16.0 in this case) ensures they are building on the most up-to-date and refined codebase.
All the vulnerabilities related to the version 2.16.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