Svelte 3.20.0 introduces incremental improvements over version 3.19.2, primarily focusing on internal enhancements and refinements rather than groundbreaking feature additions. Both versions share the same core philosophy of "cybernetically enhanced web apps," implying an emphasis on performance and developer experience. A quick comparison of devDependencies reveals virtually no changes, suggesting that the development environment and build process remain largely consistent between the two versions. This means developers can likely upgrade without encountering significant compatibility issues with their existing tooling (Rollup, Typescript, ESLint).
The dist object shows differences in the packaged size and file count. Version 3.20.0 comes with a smaller file count (200 vs 209) but slightly bigger unpacked size (3119648 vs 3094012). This can suggest some refactoring or changes in the internal structure of the package files.
For developers, the upgrade to 3.20.0 promises a more polished and efficient Svelte experience. While specific bug fixes and performance optimizations are not explicitly detailed in the provided data, the increased unpackedSize and decreased fileCount and given the lack of dependency updates likely indicate internal improvements to the Svelte compiler or runtime which could translate to tangible benefits in application performance (smaller bundle size, faster rendering) and stability. The update also keeps the package up to date with the latest internal structure. As always, reviewing the official Svelte changelog and release notes on GitHub is recommended for a comprehensive understanding of the changes and potential impact on existing projects.
All the vulnerabilities related to the version 3.20.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