Svelte version 2.15.0 is a minor update to the magical disappearing UI framework, building upon the previous stable release, 2.14.3. Both versions share the same core philosophy of shifting work from the browser to the compile step, resulting in highly performant web applications. They both offer a reactive component model, efficient rendering, and a smooth development experience. The developer dependencies remain largely consistent between the two versions, encompassing tools for testing (mocha, nyc, jsdom), linting (eslint), bundling (rollup), and TypeScript support, crucial for maintaining code quality and a modern development workflow.
While the core feature set remains fundamentally the same, visible in the identical 'description' and 'devDependencies' the upgrade brings improvements and possibly bug fixes that can subtly enhance the development experience or application stability. Examining the "dist" property, we see 'fileCount' increased from 12 to 13 and 'unpackedSize' went from 956464 to 967263,suggesting additional or modified files contributing to a slightly bigger library; these differences are important because they could suggest new features or internal improvements. The release date of 2.15.0 (2018-10-28) is also later than that of 2.14.3 (2018-10-24), confirming it as the more recent version, and highlighting the continuous development and maintenance efforts dedicated to the framework. Therefore, while both versions promise performant UI development, upgrading to 2.15.0 is recommended to benefit from the latest refinements.
All the vulnerabilities related to the version 2.15.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