CVE-2025-15265: Svelte Cross-Site Scripting Vulnerability
MODERATECVE-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
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.
npm install svelte@5.46.4
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
CVE-2025-15265 Affected Svelte Versions
1 component(s)| 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?
Which Svelte versions are affected?
What version fixes CVE-2025-15265?
Is svelte affected?
What CWE is associated with CVE-2025-15265?
How can I check npm dependencies for CVE-2025-15265?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}