Svelte 3.19.1 represents a minor patch release over its predecessor, Svelte 3.19.0, both continuing to deliver the promise of cybernetically enhanced web application development. While the core functionality remains consistent, a closer look reveals subtle distinctions. Examining the dist properties, Svelte 3.19.1 demonstrates a slight increase in unpacked size (3081728 bytes) compared to 3.19.0 (3081594 bytes) and a decrease in fileCount field (207 vs 209), hinting at internal modifications, potentially bug fixes, or very minor feature enhancements, and a slight reorganization of files.
Both versions share identical development dependencies, showcasing a stable development environment. These dependencies encompass a robust suite of tools, including Rollup for bundling, TypeScript for type checking, ESLint for code linting, and testing frameworks like Mocha. This comprehensive toolchain ensures developer productivity and code quality. The release dates also provide context; version 3.19.1 followed shortly after 3.19.0, suggesting a quick resolution of any issues discovered immediately post-release of 3.19.0. While not explicitly stated, this iterative approach emphasizes the Svelte team's commitment to stability and addressing user feedback promptly. For developers, choosing between these versions likely depends on the specific project needs, and sticking with the newer version is advisable unless compatibility issues arise.
All the vulnerabilities related to the version 3.19.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