Svelte version 3.25.1 represents a minor update over its predecessor, version 3.25.0, within the Svelte framework ecosystem. Both versions maintain the core description of "Cybernetically enhanced web apps," emphasizing Svelte's commitment to building performant and efficient user interfaces. The development dependencies remain consistent, featuring a comprehensive toolkit for development, testing, and linting. Key tools include Rollup for bundling, ESLint for code quality, and TypeScript for static typing, ensuring a robust development experience. Libraries like magic-string, css-tree, and estree-walker showcase Svelte's underlying architecture for efficient code transformation and manipulation.
While the core functionality and developer dependencies remain largely unchanged, the critical difference lies in the "dist" section. Version 3.25.1 has a slightly larger unpacked size of 5898820 bytes compared to 3.25.0's 5896150 bytes. This subtle difference often indicates bug fixes, performance enhancements, or minor feature additions incorporated into the newer release. The release date also distinguishes them, with version 3.25.1 being released on September 15, 2020, following version 3.25.0's release on September 10, 2020. For developers, upgrading from 3.25.0 to 3.25.1 is recommended to benefit from the latest improvements and bug fixes, ensuring optimal performance and stability in their Svelte applications.
All the vulnerabilities related to the version 3.25.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