Svelte 3.59.2 and 3.59.1 are both iterations of the popular Svelte JavaScript compiler, designed to build reactive web applications with a focus on performance and developer experience. Both versions share the same core description: "Cybernetically enhanced web apps", reflecting Svelte's aim to enhance web development through innovative compilation techniques. The key details like the license (MIT), repository location, and author remain consistent, indicating a continuation of the project's established practices.
Examining the devDependencies reveals near identical sets of tools, encompassing utilities for testing (Mocha, jsdom), linting (eslint), bundling (Rollup), and TypeScript support. This consistency points to a stable development environment and a commitment to code quality. Specific versions of these dependencies are largely the same, ensuring a predictable build process for developers.
The most notable differences lie in the dist object and releaseDate. Version 3.59.2 was released on June 20, 2023, while 3.59.1 came out on May 8, 2023, representing a little over a month between releases. The slight variation in unpackedSize (10624206 vs 10624099) suggests minor code adjustments, likely bug fixes or small feature enhancements.
For developers, migrating from Svelte 3.59.1 to 3.59.2 should be a straightforward process unless you rely on undocumentated features. The common dependency versions suggest a smooth transition. The newer version likely contains bug fixes and incremental improvements, making it the preferred choice for new projects and updates. Always review Svelte's official release notes for a detailed breakdown of the changes. Because of the small changes, most of the work should be focused on documenting the work.
All the vulnerabilities related to the version 3.59.2 of the package
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