Svelte version 3.16.3 is a minor release following 3.16.2, both iterations building upon the core functionality of this popular JavaScript framework designed for crafting high-performance web applications. Svelte distinguishes itself by shifting the workload from the browser to the compilation step, resulting in smaller, faster JavaScript bundles executed with exceptional efficiency.
A comparison of the two versions reveals subtle changes with only the unpackedSize and releaseDate properties varying, suggesting an incremental update that may include bug fixes, performance enhancements, or minor feature adjustments rather than substantial API alterations. The unpacked size of version 3.16.3 is slightly larger at 3055753 compared to 3053121 in 3.16.2. And version 3.16.3 was released several minutes later than version 3.16.2.
For developers, this signifies a stable environment where upgrading from 3.16.2 to 3.16.3 is unlikely to introduce compatibility issues or require significant refactoring. The continued reliance on the same set of development dependencies underscores the commitment to a consistent development experience. As always, developers should consult the changelog and release notes for a detailed breakdown of the specific improvements and fixes included in version 3.16.3 to ensure a smooth transition. This iterative approach reinforces Svelte's dedication to refinement and providing a solid foundation for building modern web experiences.
All the vulnerabilities related to the version 3.16.3 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