Svelte versions 3.46.5 and 3.46.4 are both iterations of the popular JavaScript compiler that transforms component code into highly efficient, framework-less vanilla JavaScript. Both share the core purpose of building cybernetically enhanced web applications and offer a similar set of development dependencies for tasks like linting (eslint), code transformation (rollup, sucrase, typescript), testing (mocha, jsdom) and static analysis. Developers familiar with the Svelte ecosystem will find a consistent development experience across these two versions.
However, a closer inspection reveals subtle discrepancies. Version 3.46.5 has a slightly larger unpacked size (7103568 bytes) and file count (239 files) compared to version 3.46.4 (7099635 bytes and 238 files respectively). This suggests that the newer version includes minor enhancements, bug fixes, or potentially updated internal tooling not present in the previous release. The release dates also highlight a significant difference, with version 3.46.5 being released approximately two months after 3.46.4. This time frame likely encompasses the implemented changes.
For developers, upgrading from 3.46.4 to 3.46.5 is generally recommended to benefit from the latest improvements and potential security patches. While the changes might be incremental, staying up-to-date ensures access to the most refined and stable version of the compiler. Before upgrading, reviewing the changelog or release notes (available on the Svelte GitHub repository) can provide specific details on the included modifications, helping developers anticipate any potential impact on their projects. The core Svelte development experience remains consistent between versions ensuring relatively seamless transition.
All the vulnerabilities related to the version 3.46.5 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