@astrojs/svelte@9.1.1

Use Svelte components within Astro

  • latest version

    9.1.6

  • latest non vulnerable version

  • first published

    4 years ago

  • latest version published

    5 days ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the @astrojs/svelte package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • L
    Cross-site Scripting (XSS)

    @astrojs/svelte is an Use Svelte components within Astro

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the renderToStaticMarkup server renderer and the client-side hydration code, which wrap slotted content in an <astro-slot> element and write the slot name directly into its name attribute without HTML escaping. A slot name containing " can break out of the attribute context and inject arbitrary HTML into the rendered page. An attacker who controls a slot name - for example through a query parameter passed as a slot name - can cause arbitrary JavaScript to execute on the site's origin.

    Note: This is only exploitable when the page passes request-controlled input as a slot name, the Svelte component is hydrated with a client:* directive, and the component renders the attacker-chosen slot by dynamic name (in practice, a Svelte 5 component using {@render snippets[active]?.()}).

    How to fix Cross-site Scripting (XSS)?

    Upgrade @astrojs/svelte to version 9.1.2 or higher.

    >=5.7.3 <9.1.2
    • L
    Cross-site Scripting (XSS)

    @astrojs/svelte is an Use Svelte components within Astro

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via unescaped slot names in the @astrojs/svelte renderer's astro-slot wrapper element. The renderer inserts a named slot into the quoted name attribute of an <astro-slot> element without HTML escaping, in both server.ts and client.svelte.ts. A request-controlled slot name containing a double-quote character can terminate the attribute and inject arbitrary active HTML into the page, enabling reflected cross-site scripting. Both server-side rendering and client-side hydration paths use the unsafe slot name value.

    Note: This is only exploitable when the page passes request-controlled input as a slot name, the Svelte component is hydrated with a client:* directive, and the component dynamically renders the attacker-chosen slot (e.g. a Svelte 5 component rendering snippets by a dynamic name).

    How to fix Cross-site Scripting (XSS)?

    Upgrade @astrojs/svelte to version 9.1.2 or higher.

    >=5.7.3 <9.1.2