Svelte version 1.13.4 is a minor patch release following 1.13.3 in the early days of this "magical disappearing UI framework". Both versions share the same MIT license, author (Rich Harris), and core description, emphasizing the framework's ability to compile away into highly optimized vanilla JavaScript. The primary difference lies in their release dates; version 1.13.4 was published a few hours after 1.13.3, suggesting it addresses a quick fix or minor adjustment discovered shortly after the initial release.
For developers, this close succession signals a period of rapid iteration, common in early-stage projects. While the core functionality and API remained stable, potential users will want to look into the commit history for those specific hours between the releases (if available) to understand the exact nature of the patch. Given the extensive list of shared devDependencies, encompassing tools for testing (mocha, jsdom), linting (eslint), bundling (rollup), and transpilation (babel), both versions demonstrate a strong commitment to code quality, modern JavaScript standards, and a robust development pipeline. New users might find this reassuring, knowing that the project prioritizes maintainability and a smooth developer experience. However, due to their age these versions are outdated and do not represent the current state of Svelte. It is highly recomended to use more recent stable releases of Svelte.
All the vulnerabilities related to the version 1.13.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