Svelte 3.4.3 is a minor patch release in the Svelte 3 series, focusing on refinements and dependency updates to enhance the developer experience around this cybernetically enhanced web app compiler. While both versions 3.4.2 and 3.4.3 share the same core description, the key difference lies in the updated devDependencies. Specifically, version 3.4.3 upgrades the typescript dependency from version 3.0.1 to version 3.4.0. Usually, this indicates improved compatibility with the latest TypeScript features and potentially includes fixes for type-checking related bugs that may have affected Svelte components.
For developers using TypeScript with Svelte, this update could be particularly important. Svelte relies on TypeScript (and related tools) during its build process to ensure type safety and provide helpful tooling integrations. The upgrade suggests a more robust and modern TypeScript integration. Additionally, the dist object reveals that version 3.4.3 has a slightly larger file count (27 vs 21) and unpacked size (1037422 vs 1017975) compared to version 3.4.2, meaning the newer version likely includes additional files or adjustments that contribute to the overall functionality and stability of the package. The release date also shows that 3.4.3 was released a few days later than 3.4.2.
All the vulnerabilities related to the version 3.4.3 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