Svelte 3.23.1 represents a minor update over its predecessor, Svelte 3.23.0, primarily focusing on refinements and dependency adjustments within the development environment. Both versions share the same core description: "Cybernetically enhanced web apps," highlighting Svelte's commitment to building performant and streamlined user interfaces.
The key distinctions lie in the devDependencies section, reflecting changes in the tools used for development and testing of the Svelte library itself. 3.23.1 upgrades eslint from version 6.3.0 to 7.1.0, eslint-plugin-import from 2.18.2 to 2.20.2, and introduces @sveltejs/eslint-config at version github:sveltejs/eslint-config#v0.0.1. Crucially, it also bumps the @typescript-eslint family of packages, specifically @typescript-eslint/parser from 2.1.0 to 3.0.2, and @typescript-eslint/eslint-plugin from 1.13.0 to 3.0.2. These updates suggest improvements in code linting, TypeScript support, and adherence to Svelte's recommended coding style.
For developers using Svelte, these changes translate to a potentially smoother and more consistent development experience. The updated ESLint configurations ensure better code quality and fewer potential errors. The TypeScript-related upgrades bring enhanced type checking and improved integration with TypeScript projects. While the core functionality of Svelte remains unchanged, these updated toolchains may contribute to improved developer productivity and a more robust development workflow when building Svelte applications. The dist also changes, with less fileCount (201 vs 205), and a slightly bigger unpackedSize (3134534 vs 3127579), but these are minor details.
All the vulnerabilities related to the version 3.23.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