Svelte version 3.42.3 arrived shortly after 3.42.2, bringing subtle refinements to this popular JavaScript framework known for its compiler-first approach. Both versions share the same core description: "Cybernetically enhanced web apps," reflecting Svelte's focus on performance and developer experience. Analyzing the package.json files reveals minimal differences in their development dependencies, suggesting no significant tooling changes between the releases. All peer dependencies are identical, ensuring compatibility with existing project setups. Notably, both versions bundle the same number of files (229).
The crucial distinction lies in the dist object: version 3.42.3 has a slightly larger unpacked size, 6929496 bytes compared to 6929180 bytes in version 3.42.2. This minor increase could indicate bug fixes, performance improvements, or small feature additions. The release dates also highlight the close proximity of these versions, with 3.42.3 released just a few days after 3.42.2; 2021-08-24 and 2021-08-20 respectively.
For developers, this suggests a quick follow-up release in 3.42.3. While the differences seem minimal at the dependency level, it's always a good practice to check the official Svelte changelog for detailed information on specific fixes or enhancements packaged in version 3.42.3. Upgrading to the newest version ensures you are using the most stable and potentially performant iteration of the framework.
All the vulnerabilities related to the version 3.42.3 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