Svelte 3.10.0 is a minor version update following 3.9.2 in the Svelte framework, a popular choice for building reactive web applications with a compiler-first approach. Both versions share the core goal of creating cybernetically enhanced web apps. Examining the metadata reveals a slight increase in the unpacked size of the package, from 2,811,902 bytes in version 3.9.2 to 2,820,711 bytes in 3.10.0, alongside a single file more in the newer version highlighting possible additions to the compiler or runtime.
The release dates indicate a short development cycle, with 3.10.0 being released just days after 3.9.2. While the devDependencies remain identical, suggesting no changes in the tooling used for development, the increased size could indicate bug fixes, performance improvements, or new features within the core Svelte compiler or runtime. Developers upgrading from 3.9.2 should likely expect subtle enhancements and potentially improved stability. These incremental updates are typical of semantic versioning, where minor versions often introduce backward-compatible features or fixes. It's worth checking the official Svelte changelog or release notes for a detailed list of changes included in 3.10.0 to leverage the improvements. Regular updates ensure access to the latest optimizations and bug fixes for a smoother developer experience.
All the vulnerabilities related to the version 3.10.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