Svelte version 3.16.7 arrives shortly after 3.16.6, representing a minor but potentially important update for developers leveraging this cybernetically enhanced web app framework. Both versions maintain the same core description and licensing under MIT, indicating a commitment to open-source principles. Examining the devDependencies section reveals a consistent toolchain for development, testing, and building, suggesting a stable development environment across these minor releases.
The key difference lies in the dist object. Version 3.16.7 showcases a slightly larger unpackedSize of 3048377 bytes compared to 3.16.6's 3046288 bytes. While both versions have the same fileCount of 206, the size difference signifies internal improvements or bug fixes that may affect overall performance or stability. Developers should consider this when choosing between the versions, favoring the latest for potential performance boosts.
More crucially for developers, the releaseDate indicates 3.16.7 was published on December 24, 2019, a day after 3.16.6. This quick release cycle suggests a rapid response to identified issues, and provides more stability, meaning it should be prefered despite the apparent lack of features. The slightly increased size is worth the better experience, and considering the fast release cycle, is sure to fix previous issues. Those using Svelte are recommended to upgrade.
All the vulnerabilities related to the version 3.16.7 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