Svelte 1.48.0 represents a minor version update over 1.47.2 in the Svelte framework, known for its "magical disappearing UI" approach. Both versions share the same core description, indicating a continued focus on compiling components away into highly efficient vanilla JavaScript during build time, resulting in performant web applications. The developer experience remains consistent, with Rich Harris as the author and the project licensed under MIT. The repository URL stays the same, ensuring access to the source code and contribution guidelines.
A notable difference lies in the releaseDate, with version 1.48.0 being released on December 14, 2017, shortly after version 1.47.2's release on December 13, 2017. This suggests rapid iteration and bug fixes or minor feature additions. The dist.tarball URLs differ, pointing to version-specific package files on the npm registry.
Comparing the devDependencies, both versions exhibit an identical set of tools, including testing frameworks like Mocha, linting tools like ESLint, and build tools like Rollup. This signals a stable development environment, consistent across both releases. Developers can be assured of a similar toolchain and workflow when upgrading from 1.47.2 to 1.48.0. The specific changes between these versions would likely involve bug fixes, performance improvements, or minor API adjustments, contributing to the overall stability and maturity of the Svelte framework. It's recommended to consult the official Svelte changelog for precise details on these changes.
All the vulnerabilities related to the version 1.48.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