Svelte version 2.9.0 builds upon the solid foundation of 2.8.1, offering incremental improvements for developers leveraging this magical disappearing UI framework. Both versions share the same core description, emphasizing Svelte's unique approach to web development: compiling components into highly efficient vanilla JavaScript during the build process, leading to exceptional runtime performance. The developer experience remains consistent, with access to a rich ecosystem of tooling, including Rollup plugins for bundling, ESLint plugins for code quality, and TypeScript support for enhanced type safety.
A peek at the devDependencies reveals nearly identical dependencies between the two versions, indicating a focus on stability and refinement rather than radical changes. This means developers can upgrade from 2.8.1 to 2.9.0 with minimal disruption to their existing workflows. The key difference lies in the dist object, where 2.9.0 shows a slightly larger unpackedSize (2571479 bytes vs. 2568357 bytes) and a later releaseDate, indicating that bug fixes, performance tweaks, or minor feature additions are present. While the specifics of these changes are not detailed, the small size difference suggests that the update prioritizes improvements within the existing codebase, making version 2.9.0 a worthwhile, low-risk upgrade for developers seeking the latest advancements and refinements within the Svelte 2.x series. Users should check the Svelte changelog for the specifics on what was addressed during the 6 days between both releases.
All the vulnerabilities related to the version 2.9.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