Svelte version 3.32.3 is a minor update to the popular Svelte JavaScript compiler, building upon the solid foundation of version 3.32.2. While the core functionality remains consistent, developers will appreciate the subtle improvements and potential bug fixes that contribute to a more polished experience. Both versions share the same core set of development dependencies, ensuring a smooth transition for those already using Svelte. These dependencies include tools for testing (mocha, c8, jsdom), linting (eslint), code transformation (rollup, sucrase), and TypeScript support, reflecting Svelte's commitment to developer productivity and code quality. Key utilities like magic-string, estree-walker, and css-tree underscore the compiler's sophisticated handling of code manipulation and styling.
The most noticeable change for end-users might be the slightly larger unpacked size of version 3.32.3 (6545049 bytes) compared to 3.32.2 (6544352 bytes), which suggests potential additions or modifications to the compiled output or internal libraries. While seemingly minor, this can indicate performance enhancements or added features within the framework. The release date difference reveals that 3.32.3 came approximately three days after 3.32.2, typical for patch releases addressing minor issues or refinements identified in the earlier version. Although the changelog details aren't provided here, a quick check of the official Svelte repository on GitHub is highly recommended to fully leverage the benefits of this incremental upgrade.
All the vulnerabilities related to the version 3.32.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