Svelte 4.2.14 represents a recent incremental update to the Svelte JavaScript framework, building upon the foundation laid by version 4.2.13. Both versions, described as tools for crafting "cybernetically enhanced web apps," share identical core dependencies and development dependencies, indicating a focus on stability and refinement rather than sweeping architectural changes. Crucially, the dependency lists, including essential packages like acorn for parsing, css-tree for CSS manipulation, and magic-string for source code transformation, remain consistent. Similarly, the devDependencies used for testing and building, such as rollup, vitest, and typescript, are unchanged.
The key difference lies in the dist metadata reflecting the packaged distribution. Svelte 4.2.14 has a slightly smaller unpacked size (2632849 bytes) compared to Svelte 4.2.13 (2632877 bytes), even though both versions contain the same number of files (250). This tiny difference suggests minor optimizations or adjustments in compression or included assets. The release dates also highlight the update, with 4.2.14 released just two days after 4.2.13. This type of frequent update cycle typically indicates bug fixes, performance improvements, or minor feature enhancements. For developers, upgrading from 4.2.13 to 4.2.14 should be seamless, offering the benefits of recent fixes without introducing breaking changes. Monitoring the Svelte changelog is always a good practice to understand the precise details of these minor updates.
All the vulnerabilities related to the version 4.2.14 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