Svelte version 4.2.11 is a minor release following 4.2.10, both under the umbrella of the Svelte 4 series, known for its focus on performance and developer experience in building reactive web applications. The core functionality and approach to component-based development remains consistent between the two versions, offering a familiar environment for Svelte developers. The dependency structure is identical, meaning no changes in the underlying tools and libraries that Svelte relies on for parsing, code transformation, and accessibility checks, such as Acorn, css-tree, and aria-query.
The real difference between 4.2.10 and 4.2.11 lies beneath the surface, with possible bug fixes, performance tweaks, or internal refactorings aimed at enhancing stability and efficiency. The slight increase in "unpackedSize" hints towards a refined codebase, potentially indicative of added comments, small code adjustments, or updated assets. Typically, patch releases (the last number in the versioning) signify improvements rather than radical changes.
For developers, upgrading from 4.2.10 to 4.2.11 should be a straightforward process, most likely requiring a simple npm install svelte@latest or its equivalent using other package managers. Given the similar dependency profile, compatibility issues are unlikely. While the release notes would provide precise details, the upgrade is expected to enhance existing projects without introducing breaking changes. Therefore, the jump to 4.2.11 is recommended for a potentially more robust and polished Svelte development experience.
All the vulnerabilities related to the version 4.2.11 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