Svelte version 1.45.0 represents an incremental update over the previous stable version, 1.44.2, both iterations emphasizing Svelte's core mission: a magical disappearing UI framework. Developers considering adopting or upgrading to 1.45.0 will primarily find a refinement of the existing feature set rather than groundbreaking changes. Crucially, both versions depend upon an identical suite of development dependencies, indicating a consistent build and testing environment. This includes tools like Rollup for bundling, ESLint for code linting, TypeScript for type checking, and Mocha for testing, assuring developers of a well-supported development experience.
While the core functionality remains consistent, subtle improvements and bug fixes are expected to be present in 1.45.0, contributing to an enhanced developer experience and potentially optimized runtime performance. The unchanged development dependency list suggests a focus on internal improvements and refinements within the Svelte compiler and runtime. The release date difference, a mere two days, suggests a quick patch or minor feature addition warranted a new release. For existing Svelte users, upgrading to 1.45.0 ensures access to the latest bug fixes and potential performance enhancements, contributing to a more stable and efficient application. New users can be confident in starting with either version, knowing the foundational tooling and development environment remain consistent.
All the vulnerabilities related to the version 1.45.0 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