CVE-2026-27121: Svelte Cross-Site Scripting Vulnerability
MODERATECVE-2026-27121 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 affected by cross-site scripting via spread attributes in svelte ssr. Remediation is available by upgrading affected packages to version 5.51.5.
CVE-2026-27121 at a Glance
How to Fix CVE-2026-27121
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.51.5
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-27121, 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.51.5), 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-2026-27121 Affected Svelte Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
svelte
|
npm |
< 5.51.5
|
5.51.5
|
References
Frequently Asked Questions
What is CVE-2026-27121?
Which Svelte versions are affected?
What version fixes CVE-2026-27121?
Is svelte affected?
What CWE is associated with CVE-2026-27121?
How can I check npm dependencies for CVE-2026-27121?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-f7gr-6p89-r883",
"modified" : "2026-02-23T22:23:05Z",
"published" : "2026-02-19T15:18:33Z",
"aliases" : [ "CVE-2026-27121" ],
"summary" : "Svelte affected by cross-site scripting via spread attributes in Svelte SSR",
"details" : "Versions of svelte prior to 5.51.5 are vulnerable to cross-site scripting (XSS) during server-side rendering. 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.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:H/AT:P/PR:H/UI:N/VC:L/VI:N/VA:N/SC:H/SI:H/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "svelte"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.51.5"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 5.51.4"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/sveltejs/svelte/security/advisories/GHSA-f7gr-6p89-r883"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-27121"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/sveltejs/svelte"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-02-19T15:18:33Z",
"nvd_published_at" : "2026-02-20T23:16:02Z"
}
}