Vulnerabilities in pkg:npm/svelte

PACKAGE
Advisory Identifier: GHSA-pr6f-5x2q-rwfp
Advisory Summary

CVE-2026-42599 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Svelte libraries in the npm ecosystem. The issue involves svelte ssr vulnerable to cross-site scripting via spread attributes. Remediation is available by upgrading affected packages to version 5.55.7.

14 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/svelte

14 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/svelte. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-pr6f-5x2q-rwfp CVE-2026-42599 MODERATE Svelte SSR vulnerable to cross-site scripting via spread attributes
GHSA-rcqx-6q8c-2c42 CVE-2026-42573 MODERATE Svelte Vulnerable to XSS via DOM Clobbering of Internal Framework State
GHSA-9rmh-mm8f-r9h6 CVE-2026-42567 MODERATE Svelte: ReDoS in `<svelte:element>` Tag Validation
GHSA-f3cj-j4f6-wq85 - MODERATE Svelte: SSR XSS via Insecure Promise Serialization in hydratable
GHSA-qgvg-pr8v-6rr3 CVE-2026-27902 MODERATE Svelte: XSS via HTML Comment Injection in SSR Error Boundary Hydration Markers
GHSA-phwv-c562-gvmh CVE-2026-27901 MODERATE Svelte vulnerable to XSS during SSR with contenteditable `bind:innerText` and `bind:textContent`
GHSA-crpf-4hrx-3jrp CVE-2026-27125 MODERATE Svelte SSR attribute spreading includes inherited properties from prototype chain
GHSA-m56q-vw4c-c2cp CVE-2026-27122 MODERATE Svelte SSR does not validate dynamic element tag names in `<svelte:element>`
GHSA-f7gr-6p89-r883 CVE-2026-27121 MODERATE Svelte affected by cross-site scripting via spread attributes in Svelte SSR
GHSA-h7h7-mm68-gmrc CVE-2026-27119 MODERATE Svelte affected by XSS in SSR `<option>` element
GHSA-gw32-9rmw-qwww - HIGH svelte is vulnerable to XSS with textarea bind:value
GHSA-6738-r8g5-qwp3 CVE-2025-15265 MODERATE svelte vulnerable to Cross-site Scripting
GHSA-8266-84wp-wv5c CVE-2024-45047 MODERATE Svelte has a potential mXSS vulnerability due to improper HTML escaping
GHSA-wv8q-r932-8hc7 CVE-2022-25875 MODERATE Svelte vulnerable to XSS when using objects during server-side rendering

CVE-2026-42599 at a Glance

CVE Identifier CVE-2026-42599
GHSA Identifier GHSA-pr6f-5x2q-rwfp
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Svelte
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-42599

To remediate this vulnerability, upgrade all affected Svelte dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

svelte fixed: 5.55.7
npm install svelte@5.55.7
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls svelte

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-42599, inspect your project dependencies using npm:

npm ls svelte

Analyze the terminal output to locate any version of Svelte in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.55.7), your application is affected.

Note: The npm ls svelte command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Svelte, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

When using spread syntax to render attributes from untrusted data, event handler properties are included in the rendered HTML output. If an application spreads user-controlled or external data as element attributes, an attacker can inject malicious event handlers that execute in victims' browsers. Note that this vulnerability _only_ triggers if the user's browser has JavaScript enabled but Svelte's hydration mechanism does not reach the vulnerable element before the event fires. This is similar to but different from [CVE-2026-27121](https://nvd.nist.gov/vuln/detail/CVE-2026-27121).

CVE-2026-42599 Affected Svelte Versions

1 component(s)
Fixed Versions:
5.55.7
Product / Package Ecosystem Affected Versions Fixed Version
svelte
npm
< 5.55.7
5.55.7

References

Frequently Asked Questions

What is CVE-2026-42599?
CVE-2026-42599 is a security vulnerability in Svelte involving Svelte SSR vulnerable to cross-site scripting via spread attributes under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Svelte versions are affected?
Affected versions include releases prior to 5.55.7 across affected packages: svelte.
What version fixes CVE-2026-42599?
Upgrading to 5.55.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is svelte affected?
Yes, svelte is affected in releases prior to 5.55.7. Upgrade your dependency to 5.55.7 or later.
What CWE is associated with CVE-2026-42599?
CVE-2026-42599 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2026-42599?
Run the dependency tree command: 'npm ls svelte'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pr6f-5x2q-rwfp",
  "modified" : "2026-06-09T18:41:32Z",
  "published" : "2026-05-14T20:19:42Z",
  "aliases" : [ "CVE-2026-42599" ],
  "summary" : "Svelte SSR vulnerable to cross-site scripting via spread attributes",
  "details" : "When using spread syntax to render attributes from untrusted data, event handler properties are included in the rendered HTML output. If an application spreads user-controlled or external data as element attributes, an attacker can inject malicious event handlers that execute in victims' browsers. Note that this vulnerability _only_ triggers if the user's browser has JavaScript enabled but Svelte's hydration mechanism does not reach the vulnerable element before the event fires.\n\nThis is similar to but different from [CVE-2026-27121](https://nvd.nist.gov/vuln/detail/CVE-2026-27121).",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:P/PR:H/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "svelte"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.55.7"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.55.6"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/sveltejs/svelte/security/advisories/GHSA-pr6f-5x2q-rwfp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-27121"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-42599"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sveltejs/svelte"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sveltejs/svelte/releases/tag/svelte%405.55.7"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-14T20:19:42Z",
    "nvd_published_at" : "2026-06-09T17:17:07Z"
  }
}