Svelte 3.38.0 introduces several noteworthy updates compared to its predecessor, version 3.37.0, enhancing the developer experience and overall performance. While both versions maintain the core promise of "Cybernetically enhanced web apps," subtle shifts in the development dependencies signal improvements in tooling and code quality.
One key difference is the upgrade of the jsdom dependency from version 15.1.1 to 15.2.1. Developers leveraging server-side rendering or testing components within a Node.js environment will benefit from the bug fixes and enhancements included in this jsdom update, leading to more reliable and consistent testing.
Furthermore, while most development dependencies remain at the same version, their sheer number highlights Svelte's commitment to robust testing and linting. Tools like eslint, @typescript-eslint/parser, and @typescript-eslint/eslint-plugin, all pinned at specific versions, ensure a consistent development environment regardless of the version used. The inclusion of packages like codecov indicates a focus on code coverage, ultimately translating to higher-quality and more reliable components for developers using the framework.
Although the fileCount remains steady at 222, the unpackedSize sees a slight increase from 6590886 to 6614443, likely due to added features or improvements within the core runtime or compiler. Svelte continues to be licensed under MIT, emphasizing its commitment to open-source principles and developer accessibility. Finally, a nearly one-month difference in releaseDate, gives a context of the frequency of releases, with developers in mind providing upgrades in reasonable periods.
All the vulnerabilities related to the version 3.38.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