Svelte 4.2.8 is a minor patch release following version 4.2.7, both maintaining the core promise of "Cybernetically enhanced web apps." Examining the package data reveals almost identical dependency and devDependency lists, suggesting the update likely focuses on bug fixes, performance tweaks, or internal improvements rather than introducing significant new features. Both versions rely on the same suite of tools including Acorn for parsing, css-tree for CSS processing, and Rollup for bundling, indicating a stable and consistent development environment. The development dependencies such as Vitest, Playwright, and TypeScript ensure robust testing and type safety for Svelte projects.
While the dependency lists are the same, there are subtle differences in the dist section. Specifically, the unpackedSize of version 4.2.8 is slightly larger (2632281 bytes) than 4.2.7 (2631929 bytes), and release dates differ, confirming the newest version to be a newer build. The file count of 249 remains the same. This marginal size increase might be due to minor code additions or adjustments related to bug fixes. Given the shared dependency versions, developers can expect a seamless upgrade experience, facing minimal breaking changes. The update provides a more robust and stable foundation for building Svelte applications, ensuring developers benefit from the latest refinements and optimizations integrated into the framework. Therefore, especially for existing Svelte projects, upgrading to version 4.2.8 is recommended.
All the vulnerabilities related to the version 4.2.8 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