Svelte version 1.6.4 represents a minor iteration over its predecessor, 1.6.3, both maintaining the core promise of a "magical disappearing UI framework." For developers, this means continued stability and refinement of the component-based approach to building web applications. Diving into the package metadata reveals few discernible changes in the listed dependencies and devDependencies. Both versions rely on the same core ecosystem: magic-string for source code manipulation, testing frameworks like mocha and jsdom, and build tools such as rollup. The development dependencies include tools like eslint and babel plugins, suggesting a continued commitment to code quality and modern JavaScript syntax support.
However, the key difference lies in the release date; 1.6.4 arrived approximately two weeks after 1.6.3. Although there are no visible changes in dependencies or the repository details, this date difference indicates that 1.6.4 likely contains bug fixes, performance improvements, or minor internal adjustments not reflected in the package manifest. Developers who prioritize the most up-to-date and stable experience should therefore favor version 1.6.4. Both versions inherit the MIT license and credit Rich Harris as the author, reinforcing the consistent direction and maintainership of the Svelte project. Svelte's approach of compiling components away during build contributes to smaller bundle sizes and faster runtime performance, a valuable consideration for web developers aiming for optimal website speed.
All the vulnerabilities related to the version 1.6.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