Svelte is a radical approach to building user interfaces, shifting work from the browser to compile time. Versions 1.11.4 and 1.11.3, both described as "The magical disappearing UI framework," showcase the ongoing development and refinement of this innovative framework.
A key observation is the minimal change between these versions, suggesting a focus on stability and bug fixes rather than groundbreaking new features. Both versions share identical dependencies, relying on magic-string for efficient source code manipulation. The devDependencies also remain the same, highlighting a consistent development environment and build process. These include tools for testing (mocha, nyc, jsdom), linting (eslint), bundling (rollup), and code coverage (codecov), reflecting a commitment to code quality.
The primary difference lies in the version and releaseDate. Version 1.11.4 was released a day after version 1.11.3. This increment of .0.1 suggests that the newest release includes minor bug fixes or very small improvements.
For developers using Svelte, this points to a reliable and well-maintained framework. The consistent dependency structure ensures a predictable development experience. While the changes between these specific versions are small, staying up-to-date is generally advisable to benefit from the latest bug fixes and performance enhancements. Svelte itself offers a compelling alternative to traditional virtual DOM frameworks, resulting in smaller, faster, and more efficient web applications.
All the vulnerabilities related to the version 1.11.4 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