Svelte 1.11.0 is a minor update focusing on enhancements and bug fixes within the framework, building upon the foundation laid by version 1.10.3. Both versions share the core philosophy of being a "magical disappearing UI framework," implying a focus on performance and minimal runtime overhead, key selling points for developers seeking efficient front-end solutions.
The primary dependency, magic-string, remains unchanged, suggesting that core string manipulation and source code transformation capabilities are stable. Examining the devDependencies, we observe updates in Babel related packages. Specifically, babel-core, babel-register, and several babel-plugin-transform-es2015-* dependencies have been bumped from older versions to newer ones. These upgrades likely address bug fixes, performance improvements, or compatibility with newer JavaScript syntax features. The upgrades showcase a commitment to modern JavaScript standards and ensuring smooth compilation for developers using cutting-edge language features.
The introduction of babel-preset-env in 1.11.0 signals a shift towards a more versatile Babel configuration, automatically including the necessary transforms based on the target environment. This simplifies the build process for developers targeting different browsers or Node.js versions. The inclusion of babel-plugin-transform-es2015-spread, babel-plugin-transform-es2015-parameters, babel-plugin-transform-es2015-block-scoping, babel-plugin-transform-es2015-destructuring and babel-plugin-transform-es2015-arrow-functions suggests and effort to align with ES6 and newer Javascript standards. Although seemingly minor, these updates contribute to a more robust and developer-friendly experience. Svelte continues to prioritize a streamlined development workflow and adherence to evolving JavaScript best practices, making it an attractive option for developers looking for a performant and modern UI framework.
All the vulnerabilities related to the version 1.11.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