9.1critical
SiYuan affected by Remote Code Execution in the Electron desktop client via stored XSS in synced table captions
- Severity
- 9.1critical CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.69% (higher than 48% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-phhp-9rm9-6gr2GO-2026-5540
Description
SiYuan is a personal knowledge management system. Prior to 3.6.4, 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. This vulnerability is fixed in 3.6.4.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| siyuan-note siyuan | < 3.6.4 | CVE List |
| github.com/siyuan-note/siyuan/kernel (Go) | before 0.0.0-20260407035653-2f416e5253f1 | GitHub Advisory Database, Go Vulnerability Database |
| b3log siyuan | before 3.6.4 | NVD |
All scores
| GitHub_M | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H |
| GitHub | 9.0critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H |
| NVD | 9.0critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H |
Classification
What each source says
CVE List
SiYuan is a personal knowledge management system. Prior to 3.6.4, 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. This vulnerability is fixed in 3.6.4.
GitHub Advisory Database
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 <img src=x onerror=...> 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 execution rather than browser-only script execution. The renderer is configured with nodeIntegration: true and contextIsolation: false, so JavaScript running in the note context can call Node.js APIs directly. A payload such as require('child_process').exec('calc') executes successfully, demonstrating code execution on the victim machine in the context of the logged-in user.
PoC
- SiYuan Desktop Client A: attacker
- SiYuan Desktop Client B: victim
- Both clients are configured to use the same sync target
PoC File
I created a malicious .sy.zip note containing a table block with a crafted caption property.
Safe validation payload:
<img src=x onerror=alert('caption-xss')>
RCE validation payload on Windows:
<img src=x onerror=require('child_process').exec('calc')>
Steps to Reproduce
1.On Client A, import the crafted .sy.zip note using:
Import -> SiYuan .sy.zip
2.Confirm the imported note appears in the workspace.
3.Trigger sync on Client A so the malicious note is uploaded to the shared sync target.
4.On Client B, trigger sync so the note is downloaded from the shared sync target.
5.Open the synced note on Client B.
Observed Result
With the safe payload, JavaScript executes automatically when the victim opens the note. With the RCE payload, the Electron renderer executes:
require('child_process').exec('calc')
This launches Calculator on Windows, demonstrating code execution in the victim user's context.
Impact
- Impact Across All Platforms: Stored XSS
- Electron Desktop App: Remote Code Execution
Go Vulnerability Database
SiYuan: Remote Code Execution in the Electron desktop client via stored XSS in synced table captions in github.com/siyuan-note/siyuan/kernel
NVD (es)
SiYuan es un sistema de gestión de conocimiento personal. Antes de la versión 3.6.4, una nota maliciosa sincronizada con otro usuario puede desencadenar la ejecución remota de código en el cliente de escritorio SiYuan Electron. La causa raíz es que el contenido de la leyenda de la tabla se almacena sin un escape seguro y luego se desescapa en HTML renderizado, creando un sumidero XSS almacenado. Debido a que el renderizador de escritorio se ejecuta con nodeIntegration habilitado y contextIsolation deshabilitado, el JavaScript controlado por el atacante se ejecuta con acceso a las API de Node.js. En la práctica, un atacante puede importar una nota manipulada en un espacio de trabajo sincronizado, esperar a que la víctima sincronice y lograr la ejecución de código cuando la víctima abre la nota. Esta vulnerabilidad está corregida en la versión 3.6.4.
References
| https://github.com/siyuan-note/siyuan/security/advisories/GHSA-phhp-9rm9-6gr2 | advisory, exploit, vendor-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-39846 | advisory | |
| https://github.com/siyuan-note/siyuan | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-39846 changed 2026-04-08 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-phhp-9rm9-6gr2 changed 2026-06-25 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-5540 changed 2026-06-25 | CC-BY-4.0 |
| NVD | CVE-2026-39846 changed 2026-07-20 | Public domain |