Svelte version 3.13.0 introduces several notable updates compared to the previous stable version, 3.12.1, offering developers enhanced tooling and performance improvements. A key difference lies in the updated development dependencies, ensuring compatibility with the latest versions of essential tools. Acorn jumps from version 7.0.0 to 7.1.0, potentially providing enhanced JavaScript parsing capabilities. Source map support moves from 0.6.1 to 0.7.3, enhancing debugging workflows. Is-reference updates from 1.1.3 to 1.1.4, possibly refining how references are handled within the Svelte compiler. Rollup-plugin-replace sees an update from 2.2.0 to 2.2.1 which could mean subtle bug fixes or features related to variable replacement during bundling.
These dependency upgrades collectively contribute to a more robust and efficient development environment. The increased unpackedSize (from 2,832,720 to 3,010,104) between versions hints toward more features, bug fixes, or enhanced internal tooling. Developers should note the updated dependencies when configuring their Svelte projects. This update ensures developers benefit from the latest advancements in related tools, leading to smoother development and potentially enhanced Svelte application performance. The release date of 2019-11-10 suggests a continued commitment to improvement and modernization. Furthermore, the increased file count in the distribution archive (from 196 to 205) might reflect new features, improved documentation, or more comprehensive testing.
All the vulnerabilities related to the version 3.13.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