Svelte 3.36.0 and 3.35.0 are incremental releases of the Svelte JavaScript framework, designed for building high-performance web applications. Both versions share the core philosophy of compiling Svelte components into highly optimized vanilla JavaScript at build time, promoting excellent runtime performance and a small footprint. Key features such as reactive statements, simplified component syntax, and built-in transitions remain consistent between the two. The description, license, repository location and author also remain unchanged.
The primary differences between the versions lie in the internal improvements and bug fixes, as well as a slight change in the dist section of the package.json. The fileCount increments from 221 to 222, and the unpackedSize grows from 6,583,816 bytes to 6,590,530 bytes. This suggests minor modifications or additions to the compiled output or supporting files within the package. While the devDependencies section is identical, meaning no updates to the build environment or testing tools, these size differences hint at subtle refinements to the core compiler or runtime library. For developers, upgrading from 3.35.0 to 3.36.0 should be a straightforward process with minimal breaking changes anticipated. The release date changes from March 1st to March 30th, indicating almost a month between the releases. It's recommended to review the official Svelte changelog for detailed information about specific fixes or enhancements included in version 3.36.0.
All the vulnerabilities related to the version 3.36.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