Svelte 3.29.0 represents a minor but potentially impactful update over version 3.28.0. Both versions cater to developers building "cybernetically enhanced web apps" with Svelte's signature approach to component compilation. The core functionality remains consistent, but key differences lie in file count and unpacked size within the distribution package, indicating adjustments in internal structure, potentially including bug fixes or optimizations. Specifically, version 3.29.0 has 212 files, whereas 3.28.0 had 211. The size has also been updated, where 3.29.0 is 5984930 and the previous version 3.28.0 had 5983888. These changes may reflect improvements in build processes, documentation updates, or minor code adjustments.
For developers, these differences warrant attention primarily for ensuring smooth upgrades and compatibility. While the devDependencies remain identical, signifying no alteration in the tooling required, users should always review changelogs and migration guides (if any) to identify breaking changes or deprecated features that might necessitate code adjustments. A review of the official Svelte documentation and community resources is advisable before upgrading. These upgrades often include refinements that cumulatively enhance developer experience and application performance, keeping Svelte applications current and optimized. Be aware that these minor version bumps primarily consist of bug fixes without breaking any existing apps.
All the vulnerabilities related to the version 3.29.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