Svelte 3.24.0 introduces subtle yet important changes compared to version 3.23.2. While the core description remains consistent – "Cybernetically enhanced web apps" – hinting at Svelte's focus on performance and developer experience, the differences lie primarily in the development dependencies.
A key shift is the update of code-red from version 0.1.2 to 0.1.3. This dependency likely handles code transformation or analysis within Svelte's compilation process. Developers might experience improved code optimization or bug fixes related to code generation as a result. Acorn also gets an update, from version 7.1.0 to 7.3.1. Acorn is a javascript parser, so this update could bring support for new javascript features.
Furthermore, the file count within the distributed package has slightly increased from 203 to 205, and the unpacked size grew from 3146510 to 3174852 bytes. This suggests that the new version contains minor additions or modifications to the core library or its tooling. While not explicitly stated, developers upgrading should expect potential performance enhancements, as well as resolutions to existing issues, alongside possibly very subtle adjustments to the compiler's output. The updated release date, July 7, 2020, indicates a recent set of refinements, urging developers to consider upgrading for the latest improvements.
All the vulnerabilities related to the version 3.24.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