Svelte version 1.56.3 represents a minor iteration over its predecessor, 1.56.2, both maintained by Rich Harris and licensed under MIT. Examining the core differences reveals subtle shifts in the package's distribution. Version 1.56.3 shows a negligibly larger unpacked size of 2408099 bytes compared to 1.56.2's 2407962 bytes. This small increase typically indicates minor bug fixes, performance tweaks, or slight additions to the codebase that don't significantly alter overall functionality. Both versions were released close in time one day apart highlighting active maintenance.
Crucially, the devDependencies remain identical, suggesting the development environment and build process haven't changed between releases. Developers relying on Svelte for building user interfaces can expect a consistent experience in terms of tooling and required dependencies when upgrading from 1.56.2 to 1.56.3. The identical dependency list includes crucial tools like Rollup for bundling, TypeScript for type checking, ESLint for code linting, and various Rollup plugins for specific transformations and optimizations. The consistent use of these tools reinforces Svelte's commitment to modern web development practices.
For developers, upgrading to 1.56.3 is likely a safe and recommended update, though the exact nature of the changes would require a deeper dive into the Svelte changelog or commit history. Even a minor update could contain crucial bugfixes.
All the vulnerabilities related to the version 1.56.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