Svelte 3.46.1 represents a minor update to the popular Svelte JavaScript framework following closely after version 3.46.0. Both versions maintain the core promise of Svelte: building cybernetically enhanced web applications with a focus on performance and developer experience. Examining the metadata, the primary differences between the two releases appear to be in their distribution files, where svelte 3.46.1 shows a slightly larger unpacked size (7,077,913 bytes) compared to svelte 3.46.0 (7,071,299 bytes) and also 2 more files included in the package published to npm. This increment, along with the different release date (just one day apart), suggests that version 3.46.1 includes bug fixes or very minor enhancements over its predecessor.
For developers, this means updating from 3.46.0 to 3.46.1 should be seamless and low-risk, focusing on stability rather than introducing new features. The dependency lists remain identical, including crucial tools like Rollup for bundling, TypeScript for type checking, ESLint for code linting, and testing frameworks like Mocha. This consistent dependency structure reinforces Svelte's commitment to a stable and well-supported development environment. While the changelog is not provided in the given metadata, the nature of a patch release typically addresses critical issues discovered after the previous version, ensuring a more robust development experience. For those starting new projects, adopting the latest version (3.46.1) is generally recommended to leverage the most up-to-date refinements and fixes, promoting a smoother development workflow.
All the vulnerabilities related to the version 3.46.1 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