CVE-2026-34585 — SiYuan Desktop: Stored XSS in...
SiYuan Desktop: Stored XSS in imported .sy.zip content leads to arbitrary command execution
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.38%). Schedule for your next planned update.
Does your project use an affected github.com/siyuan-note/siyuan/kernel version?
Paste your go.sum to check it for CVE-2026-34585 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
A vulnerability allows crafted block attribute values to bypass server-side attribute escaping when an HTML entity is mixed with raw special characters. An attacker can embed a malicious IAL value inside a .sy document, package it as a .sy.zip, and have the victim import it through the normal Import -> SiYuan .sy.zip workflow. Once the note is opened, the malicious attribute breaks out of its original HTML context and injects an event handler, resulting in stored XSS. In the Electron desktop client, this XSS reaches remote code execution because injected JavaScript runs with access to Node/Electron APIs.
Details
The issue is caused by a logic regression in escapeNodeAttributeValues in kernel/filesys/tree.go.
Previously, the escaping logic converted node.KramdownIAL with parse.IAL2Map(...) before deciding whether a value needed escaping. That conversion unescaped existing entities first, so mixed values such as:
&" onmouseenter="alert('IAL-XSS')
were still recognized as unsafe and escaped correctly.
The logic changed to inspect raw KramdownIAL values directly. The new needsEscapeForValue implementation returns false as soon as it sees any known entity such as &, ", <, or >. This means a value containing both an entity and an unescaped raw quote bypasses escaping entirely.
That bypass becomes exploitable because the renderer later inserts block IAL values directly into HTML attributes. A payload like:
&" onmouseenter="require('child_process').exec('calc')
can be rendered into HTML equivalent to:
<div title="&" onmouseenter="require('child_process').exec('calc')">
This creates a stored XSS condition. In SiYuan Desktop, the Electron renderer runs with Node.js integration available, so attacker-controlled JavaScript can invoke Node APIs directly. As a result, the issue is not limited to script execution in the page context and becomes arbitrary command execution on the victim’s machine.
The stored XSS path was validated by importing a crafted .sy.zip through the normal GUI and triggering JavaScript execution from the rendered block. Because the same injected JavaScript runs in the privileged Electron renderer, this is an RCE issue in the desktop client.
PoC
- Start SiYuan Desktop
v3.6.1. - Prepare a crafted
.sy.zipcontaining a .sy document with a block IAL property such as:
"title": "&\" onmouseenter=\"require('child_process').exec('calc')"
- In the UI, right-click any notebook.
- Select
Import -> SiYuan .sy.zip. - Import the crafted archive.
- Open the imported note.
- Move the mouse over the affected paragraph block.
- Observe that the injected JavaScript executes.
- On Windows,
calc.exelaunches, demonstrating arbitrary command execution.
Impact
This vulnerability allows an attacker to deliver a malicious .sy.zip file that executes attacker-controlled JavaScript after import. In the desktop application, that JavaScript runs with Node/Electron privileges and can execute arbitrary operating system commands under the victim’s account. This makes the bug equivalent to local code execution triggered by importing and opening attacker-supplied content.
Advisory Timeline
- First published April 1, 2026 (239 days ago).
- Last revised June 25, 2026 — 86 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
go get github.com/siyuan-note/siyuan/kernel@v0.0.0-20260329142331-918d1bd9f967
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: Go (1).
| Package | Fixed In |
|---|---|
| github.com/siyuan-note/siyuan/kernel Go · Affected: All versions | 0.0.0-20260329142331-918d1bd9f967 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 8.6 score means for each attack dimension.
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
References
- https://github.com/siyuan-note/siyuan/security/advisories/GHSA-ff66-236v-p4fgWEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-34585ADVISORY
- https://github.com/siyuan-note/siyuan/issues/17246WEB
- https://github.com/siyuan-note/siyuan/commit/918d1bd9f967d888f474f6764744a3d8cca4a501WEB
- https://github.com/siyuan-note/siyuanPACKAGE
- https://github.com/siyuan-note/siyuan/releases/tag/v3.6.2WEB
Frequently Asked Questions
- What is CVE-2026-34585?
- SiYuan Desktop: Stored XSS in imported .sy.zip content leads to arbitrary command execution. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.6/10).
- How do I check if my project is affected by CVE-2026-34585?
- CVE-2026-34585 affects github.com/siyuan-note/siyuan/kernel. It has a 0.4% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-34585 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is a below-median EPSS score — only 23.9% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-54158CRITICAL
SiYuan: Stored XSS to RCE via attribute-view cell rendering in genAVValueHTML()
- CVE-2026-29183CRITICAL
SiYuan: Unauthenticated Reflected XSS via SVG Injection in /api/icon/getDynamicIcon Endpoint
- CVE-2026-34449CRITICAL
SiYuan is Vulnerable to Cross-Origin RCE via Permissive CORS Policy and JavaScript Snippet Injection
- CVE-2026-25539CRITICAL
SiYuan has Arbitrary File Write via /api/file/copyFile leading to RCE
- CVE-2026-68587HIGH
SiYuan: Full-content disclosure of publish-disabled documents via getHeading*Transaction endpoints (publish mode): reader-reachable rendered DOM with no publish-access check
- CVE-2026-68584HIGH
SiYuan: Anonymous publish-password authentication bypass via getHeadingChildrenDOM / getHeading*Transaction / getBacklinkDoc (publish mode)
- CVE-2026-66394HIGH
SiYuan: Stored and reflected XSS in SiYuan through an SVG sanitizer bypass
- CVE-2026-73608HIGH
SiYuan: getAttributeViewSearchTarget returns database row content to anonymous readers with no publish-access check, reopening the class closed one day earlier at the adjacent route