Svelte 3.30.1 is a minor version update following the 3.30.0 release of the Svelte JavaScript framework. It focuses on refinements and likely addresses bug fixes or performance improvements discovered after the 3.30.0 release. Both versions are designed for building cybernetically enhanced web applications, offering a compiler-first approach that shifts work from the browser to the build step, resulting in highly performant and efficient front-end experiences.
Developers using Svelte benefit from its declarative syntax, component-based architecture, and reactive statements, which simplify UI development. The included devDependencies such as Rollup, Typescript, and ESLint ensures a robust development environment with features like modules bundling, type checking, and code linting, supporting a high level of code quality and structure. Noteworthy is the inclusion of @sveltejs/eslint-config, which ensures that Svelte projects stay aligned with Svelte's best practices.
While the core functionality remains consistent between 3.30.0 and 3.30.1, developers should always review the changelog for the incremental release to understand the specifics of the update; typically bug fixes are the main purpose of that kind of release. A key difference between the two versions can be identified in the unpackedSize with version 3.30.1 coming in at 6265499 bytes while 3.30.0 comes in at 6249458 bytes. Because of this disparity, the bug fixes are likely in one of the core files. By keeping up to date library users will always be on the fast track to developing efficient and performant front-end experiences.
All the vulnerabilities related to the version 3.30.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