Svelte version 3.25.0 introduces several updates and improvements over its predecessor, version 3.24.1, primarily focusing on developer tooling and potentially internal optimizations impacting performance. A key difference can be observed in the devDependencies. Most notably, the mocha testing framework has been updated from version 6.2.0 to 7.0.0, suggesting potential refinements or bug fixes in the testing suite. Another significant change is the update of @types/mocha from version 5.2.7 to 7.0.0 which may expose greater improvements on auto completion feature for developers. The @sveltejs/eslint-config has been updated from *v0.0.1* to *v5.0.0* bringing improved linting rules, and potentially streamlining the code review process. Otherwise other dev dependencies remain at the same level.
Beyond tooling, a notable difference appears in the dist section. The fileCount increased from 205 to 208, and the unpacked size nearly doubled from 3,184,007 bytes to 5,896,150 bytes. This significant increase in size may indicate the inclusion of new features, assets, or more extensive documentation within the package or greater and better integrated unit testing.
For developers, these changes signal a commitment to improved code quality and a refined developer experience. While the core functionality may remain largely consistent, the updated tooling can contribute to smoother development workflows, potentially fewer bugs, and overall higher quality code. The increased package size warrants investigation to understand the specific additions, but could represent valuable new capabilities or enhancements to existing features.
All the vulnerabilities related to the version 3.25.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