Svelte version 1.42.1 is a minor patch release following 1.42.0, focusing on bug fixes and incremental improvements to this "magical disappearing UI framework." Both versions share the core philosophy of compiling away into highly efficient vanilla JavaScript during build time, resulting in faster load times and improved runtime performance for web applications.
Developers will find a robust set of tools for building reactive and dynamic UIs in both versions. While the core development experience remains consistent, a key difference lies in the TypeScript version, upgraded from 2.3.2 in v1.42.0 to 2.6.1 in v1.42.1. This signifies potential fixes and support for newer TypeScript language features, contributing to a more modern and type-safe development workflow when using TypeScript with Svelte. Additionally, estree-walker sees a minor update from version 0.5.0 to 0.5.1, suggesting minor bug fixes or performance improvements in the way Svelte traverses the Abstract Syntax Tree (AST). These small updates can contribute to stability and refinements for Svelte developers.
The release date difference indicates a rapid turnaround between the two versions, pointing to an active development cycle and prompt addressing of issues in the Svelte project. Both versions leverage a comprehensive suite of development dependencies, including Rollup for bundling, ESLint for linting, and Prettier for code formatting, ensuring a consistent and high-quality codebase. Developers who experienced issues with version 1.42.0 should upgrade to 1.42.1 for improvements and bug fixes.
All the vulnerabilities related to the version 1.42.1 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