Svelte version 3.4.1 is a minor patch release following version 3.4.0 in the Svelte framework, designed to enhance web application development with its cybernetically enhanced approach. Both versions share the same core description and author, Rich Harris, emphasizing the project's continued focus and leadership. The primary distinction lies in the release date and potential bug fixes or minor improvements incorporated within the newer version. Released just a day apart, version 3.4.1 suggests rapid iteration and responsiveness to community feedback or discovered issues.
For developers, the consistent set of devDependencies indicates a stable development environment across both versions. These dependencies encompass tools for testing (mocha, c8, jsdom, puppeteer), linting (eslint, eslint-plugin-html, eslint-plugin-import), build processes (rollup, rollup-plugin-*), and TypeScript support (typescript, ts-node, @types/node, @types/mocha). The presence of tools like css-tree and magic-string point to Svelte's sophisticated handling of CSS and code transformations internally, while packages like tiny-glob and locate-character hint at file system operations and code analysis features. The slight difference in unpackedSize may reflect these minor internal modifications or optimizations. Users should consider upgrading to 3.4.1 for the latest stability and potentially improved performance, while noting the development dependencies remain consistent, minimizing disruption to established workflows and reflecting Svelte's commitment to empowering developers with a cutting-edge web application framework.
All the vulnerabilities related to the version 3.4.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