Svelte 4.2.15 is a minor patch release in the Svelte 4.x series, following closely on the heels of version 4.2.14. Both versions share the core description of "Cybernetically enhanced web apps", highlighting Svelte's focus on performance and developer experience. The dependency lists for both versions are identical, including crucial libraries such as acorn for JavaScript parsing, css-tree for CSS processing, and magic-string for efficient string manipulation. Similarly, the development dependencies remain consistent, featuring tools like rollup for bundling, vitest for testing, and typescript for type checking.
The primary difference lies in the dist metadata. Version 4.2.15 possesses a slightly larger unpacked size (2632851 bytes) compared to 4.2.14 (2632849 bytes), indicating a very minor change in compiled output. The release date also differs, with 4.2.15 being released on April 17, 2024, and 4.2.14 on April 12, 2024. Since this is a patch version the change is likely a bugfix or other small improvement. For developers, this suggests staying updated to the latest patch version (4.2.15) is recommended to benefit from potential bug fixes and minor improvements without introducing breaking changes or new features that come with major or minor version updates. Both vesions are using the same dependencies so it is highly probably that there are no changes to the API.
All the vulnerabilities related to the version 4.2.15 of the package
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