CVE-2025-15265: Svelte Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-6738-r8g5-qwp3
CWE-79
Published
Advisory Summary

CVE-2025-15265 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 vulnerable to cross-site scripting. Remediation is available by upgrading affected packages to version 5.46.4.

CVE-2025-15265 at a Glance

CVE Identifier CVE-2025-15265
GHSA Identifier GHSA-6738-r8g5-qwp3
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-2025-15265

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.46.4
npm install svelte@5.46.4
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-2025-15265, 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.46.4), 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

## Summary An XSS vulnerability exists in Svelte 5.46.0-2 resulting from improper escaping of `hydratable` keys. If these keys incorporate untrusted user input, arbitrary JavaScript can be injected into server-rendered HTML. ## Details When using the [`hydratable`](https://svelte.dev/docs/svelte/hydratable) function, the first argument is used as a key to uniquely identify the data, such that the value is not regenerated in the browser. This key is embedded into a `<script>` block in the server-rendered `<head>` without escaping unsafe characters. A malicious key can break out of the script context and inject arbitrary JavaScript into the HTML response. ## Impact This is a cross-site scripting vulnerability affecting applications that have the `experimental.async` flag enabled and use `hydratable` with keys incorporating untrusted user input. - **Impact**: Arbitrary JS execution in the client’s browser. - **Exploitability**: Remote, single-request if key is attacker-controlled. - **Typical Outcomes**: - Session/token theft - DOM defacement - CSRF bypass via injected JS - Account takeover depending on cookie/session strategy Affected applications should upgrade to a patched version immediately.

CVE-2025-15265 Affected Svelte Versions

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

References

Frequently Asked Questions

What is CVE-2025-15265?
CVE-2025-15265 is a security vulnerability in Svelte involving svelte vulnerable to Cross-site Scripting 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.46.4 across affected packages: svelte.
What version fixes CVE-2025-15265?
Upgrading to 5.46.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is svelte affected?
Yes, svelte is affected in releases prior to 5.46.4. Upgrade your dependency to 5.46.4 or later.
What CWE is associated with CVE-2025-15265?
CVE-2025-15265 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-2025-15265?
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-6738-r8g5-qwp3",
  "modified" : "2026-01-15T22:34:22Z",
  "published" : "2026-01-15T20:13:33Z",
  "aliases" : [ "CVE-2025-15265" ],
  "summary" : "svelte vulnerable to Cross-site Scripting",
  "details" : "## Summary\n\nAn XSS vulnerability exists in Svelte 5.46.0-2 resulting from improper escaping of `hydratable` keys. If these keys incorporate untrusted user input, arbitrary JavaScript can be injected into server-rendered HTML.\n\n## Details\n\nWhen using the [`hydratable`](https://svelte.dev/docs/svelte/hydratable) function, the first argument is used as a key to uniquely identify the data, such that the value is not regenerated in the browser.\n\nThis key is embedded into a `<script>` block in the server-rendered `<head>` without escaping unsafe characters. A malicious key can break out of the script context and inject arbitrary JavaScript into the HTML response.\n\n## Impact\n\nThis is a cross-site scripting vulnerability affecting applications that have the `experimental.async` flag enabled and use `hydratable` with keys incorporating untrusted user input. \n\n- **Impact**: Arbitrary JS execution in the client’s browser.\n- **Exploitability**: Remote, single-request if key is attacker-controlled.\n- **Typical Outcomes**:\n  - Session/token theft\n  - DOM defacement\n  - CSRF bypass via injected JS\n  - Account takeover depending on cookie/session strategy\n\nAffected applications should upgrade to a patched version immediately.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "svelte"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.46.0"
      }, {
        "fixed" : "5.46.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.46.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/sveltejs/svelte/security/advisories/GHSA-6738-r8g5-qwp3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-15265"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sveltejs/svelte/commit/ef81048e238844b729942441541d6dcfe6c8ccca"
  }, {
    "type" : "WEB",
    "url" : "https://fluidattacks.com/advisories/lydian"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sveltejs/svelte"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sveltejs/svelte/releases/tag/svelte%405.46.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-15T20:13:33Z",
    "nvd_published_at" : "2026-01-15T20:16:03Z"
  }
}