Svelte 3.48.0 introduces subtle yet impactful refinements over its predecessor, version 3.47.0, enhancing the developer experience and potentially improving application performance. While the core functionality remains consistent, examining the dist field reveals that Svelte 3.48.0 brings a slight increase in both fileCount (245 vs. 243) and unpackedSize (7213877 bytes vs. 7151326 bytes). This suggests optimizations, bug fixes, or potentially new minor features have been integrated. Developers should consider exploring the detailed changelog on the Svelte GitHub repository to pinpoint the specific changes responsible for this size difference, allowing them to understand the nuances of the update.
The devDependencies remain identical between the two versions, indicating no alterations in the tooling required for development or compilation. This is positive as it offers stability and suggests smooth transitions for existing projects. Core aspects such as acorn, typescript, @rollup/plugin-typescript, and @typescript-eslint/parser preserve consistent versions, safeguarding existing build processes and minimizing potential conflicts. Developers upgrading from 3.47.0 to 3.48.0 can therefore expect a seamless transition concerning tooling dependencies. Reviewing both commit logs is still best practice when upgrading.
All the vulnerabilities related to the version 3.48.0 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