Svelte versions 1.10.1 and 1.10.2 represent minor iterations in the early stages of this "magical disappearing UI framework." Both versions share identical core dependencies, relying on "magic-string" for manipulating source code. The developer tooling, as reflected in the "devDependencies," is also consistent between the two, encompassing a suite of libraries for testing (mocha, nyc, jsdom), linting (eslint, eslint-plugin-import), module bundling (rollup, rollup-plugin-*, babel-*), code coverage (codecov, babel-plugin-istanbul), and sourcemap support (source-map, source-map-support). Utilities like "css-tree," "fuzzyset.js," "console-group," "estree-walker," and "locate-character" indicate a comprehensive development environment.
The key differentiator lies in the release date. Version 1.10.2 was published shortly after 1.10.1 on March 6, 2017, suggesting that 1.10.2 likely contains bug fixes or very minor enhancements discovered immediately following the 1.10.1 release. For developers, the update from 1.10.1 to 1.10.2 is recommended due to the expected bug fixes, ensuring a more stable and reliable development experience. Given the extremely close release dates and identical dependency listings, no significant API changes or feature additions are anticipated between the two versions. Therefore Svelte developers should upgrade from 1.10.1 to 1.10.2. It is important to check Svelte's release notes to have a greater understanding.
All the vulnerabilities related to the version 1.10.2 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