CVE-2026-27901
HTML Injection and XSS in Svelte bind:innerText on contenteditable
Publication date: 2026-02-26
Last updated on: 2026-03-05
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| svelte | svelte | to 5.53.5 (exc) |
| svelte | svelte | 5.53.5 |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-79 | 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. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability affects the Svelte web framework versions prior to 5.53.5. It involves improper escaping of the contents bound to `bind:innerText` and `bind:textContent` on elements with the `contenteditable` attribute during server-side rendering. Because these bindings were not properly escaped, an attacker could inject malicious HTML or JavaScript code, leading to Cross-Site Scripting (XSS) attacks. The vulnerability arises when untrusted data is rendered as the initial value of these bindings on the server.
The issue was fixed in version 5.53.5 by ensuring that the `innerText` and `textContent` bindings on `contenteditable` elements are properly escaped before rendering, preventing malicious scripts from executing.
How can this vulnerability impact me? :
This vulnerability can allow an attacker to perform Cross-Site Scripting (XSS) attacks by injecting malicious HTML or JavaScript into web pages rendered by the Svelte framework when using `bind:innerText` or `bind:textContent` on `contenteditable` elements. Such attacks can compromise the confidentiality and integrity of the affected system and any subsequent systems interacting with it.
- Confidentiality impact on the vulnerable system is low, but the impact on subsequent systems can be high.
- Integrity impact on the vulnerable system is none, but the impact on subsequent systems can be high.
- Availability is not affected.
The attack can be remotely exploited without requiring authentication, although it has a high attack complexity and requires specific conditions to bypass security mechanisms.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
I don't know
How can this vulnerability be detected on my network or system? Can you suggest some commands?
[{'type': 'paragraph', 'content': 'This vulnerability can be detected by identifying if your system is running a vulnerable version of the Svelte framework (version 5.53.4 or earlier) that improperly escapes `bind:innerText` and `bind:textContent` on `contenteditable` elements during server-side rendering.'}, {'type': 'paragraph', 'content': 'To detect the vulnerability on your system, you can check the installed Svelte package version using the following command in your project directory:'}, {'type': 'list_item', 'content': 'npm list svelte'}, {'type': 'paragraph', 'content': 'If the version is 5.53.4 or earlier, your system is vulnerable.'}, {'type': 'paragraph', 'content': 'Additionally, you can search your codebase for usage of `bind:innerText` or `bind:textContent` on elements with the `contenteditable` attribute to identify potential vulnerable bindings:'}, {'type': 'list_item', 'content': "grep -r 'bind:innerText' ./"}, {'type': 'list_item', 'content': "grep -r 'bind:textContent' ./"}, {'type': 'paragraph', 'content': 'Monitoring network traffic for suspicious HTML or script injection attempts in contenteditable fields may also help detect exploitation attempts, but no specific detection commands are provided.'}] [1, 2]
What immediate steps should I take to mitigate this vulnerability?
The immediate and recommended mitigation step is to upgrade the Svelte framework to version 5.53.5 or later, where the vulnerability has been fixed by properly escaping `bind:innerText` and `bind:textContent` bindings on `contenteditable` elements.
If upgrading immediately is not possible, avoid using `bind:innerText` and `bind:textContent` on `contenteditable` elements with untrusted data during server-side rendering to reduce the risk of HTML injection and Cross-Site Scripting (XSS).
Review your codebase for any such bindings and sanitize or escape data manually before rendering.
Additionally, consider implementing Content Security Policy (CSP) headers to help mitigate the impact of potential XSS attacks.