Svelte 3.26.0 represents a minor version update over 3.25.1 in the Svelte framework, a popular choice for building reactive web applications with a compiler-first approach. Both versions share the core philosophy of "cybernetically enhanced web apps," emphasizing performance and developer experience. While the description and general metadata remain consistent (same author, license, repository), a peek into the devDependencies reveals subtle yet crucial differences.
The update includes a minor bump in acorn from version 7.3.1 to 7.4.0. The update in acorn, a JavaScript parser, might bring improved support for newer JavaScript syntax, translating to better compatibility and potentially fewer parsing errors when working with modern JavaScript features.
The file count in the distribution increased slightly (from 208 to 211), and the unpacked size also saw a small increase (from 5898820 to 5915851), suggesting the addition of new features, bug fixes, or internal tweaks. Finally, the release date confirms that version 3.26.0 was released approximately one week after 3.25.1.
For developers, these small version bumps are often essential to incorporate the lasted bug fixes and enhancements without introducing larger, breaking changes. Developers should check the official Svelte changelog for a detailed account of all changes but in brief these kinds of updates are usually focused on improving developer experience and ensuring code reliability.
All the vulnerabilities related to the version 3.26.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