Svelte version 3.46.4 introduces subtle but potentially important updates compared to its predecessor, 3.46.3. Both versions share the core goal of providing a "cybernetically enhanced" approach to web application development, streamlining the creation of interactive user interfaces with a component-based architecture and a focus on performance. The primary difference lies in the updated dependency versions included in the "devDependencies" section.
Notably, code-red has been updated from 0.2.4 to 0.2.5. While seemingly minor, such updates often include bug fixes, performance improvements, or compatibility adjustments that are beneficial for developers utilizing Svelte's compiler and toolingchain. Furthermore, svelte 3.46.4 has one additional file in the dist folder (238) and a lightly bigger unpacked size of 7099635 bytes, compare to 7086022 of the previous version.
In 3.46.3 there's a dev dependency for c8":"^5.0.1" that isn't present in 3.46.4.
For developers, these changes suggest an ongoing commitment to stability and incremental improvements within the Svelte ecosystem. While the core functionality of Svelte remains consistent, staying current with the latest versions ensures that developers benefit from the most refined tooling and potential performance gains. Users should investigate the specific changelogs of the updated dependencies if they encounter any build-related issues or wish to leverage new features within those packages. Overall, the update signals a healthy development cycle focused on enhancing the developer experience and solidifying Svelte's position as a leading framework for modern web applications.
All the vulnerabilities related to the version 3.46.4 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