Svelte version 3.46.3 offers a minor update over its predecessor, 3.46.2, primarily focusing on internal improvements and bug fixes. While the core functionality and core dev dependencies remain consistent, evidenced by the largely unchanged devDependencies section including tools like Rollup, TypeScript, and ESLint for development, the key lies in subtle enhancements that contribute to a more stable and refined development experience.
Developers transitioning from or to version 3.46.2 will find the upgrade seamless, without the need to refactor existing codebases. The most visible changes reside in the increased unpacked size, from 7078265 to 7086022, and a difference in release date, highlighting recent modifications to the codebase that address existing issues or optimize performance. These small yet significant changes might include fixes for edge cases, enhanced compatibility across different environments, or improvements to overall build efficiency.
For developers using Svelte, this means a smoother workflow and a more reliable compilation and execution of their applications. The update underscores Svelte's commitment to continuous improvement and to provide a solid foundation for building performant web applications. The upgrade to 3.46.3 is recommended, as it provides a better developer experience.
All the vulnerabilities related to the version 3.46.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