SiYuan: Remote Code Execution in the Electron desktop client via stored XSS in synced table captions
Date: 2026-04
Affected: go/github.com/siyuan-note/siyuan/kernel
Attack vector: xss
Category: vulnerability-disclosure
Severity: Critical
CVE: CVE-2026-39846
CWE: CWE-79
CWE-94
CVSS: 9 (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H)

### Summary A malicious note synced to another user can trigger remote code execution in the SiYuan Electron desktop client. The root cause is that table caption content is stored without safe escaping and later unescaped into rendered HTML, creating a stored XSS sink. Because the desktop renderer runs with `nodeIntegration` enabled and `contextIsolation` disabled, attacker-controlled JavaScript executes with access to Node.js APIs. In practice, an attacker can import a crafted note into a synced workspace, wait for the victim to sync, and achieve code execution when the victim opens the note. ### Details The vulnerability exists in the table caption handling path. When a table block is parsed, the `caption` attribute is saved into the node's IAL properties without proper HTML escaping. Later, during rendering, that value is read back, passed through HTML unescaping, and written directly into the output DOM. This turns an attacker-controlled caption into active HTML inside the rendered note. I confirmed that a crafted table caption containing encoded HTML such as `&lt;img src=x onerror=...&gt;` is rendered as a live DOM element instead of inert text. This makes the issue a stored XSS. I also confirmed that the most practical delivery path is not Markdown import, but a crafted `.sy.zip` note imported into a synced workspace. Once synced to another desktop client, opening the note executes the payload automatically. In the Electron desktop client, this XSS results in code ex


Mitigations:

Architectural layers (MAESTRO):