CVE-2026-40322: SiYuan - Stored XSS & Remote Code Execution
- Cve: CVE-2026-40322
- Name: SiYuan - Stored XSS & Remote Code Execution
- Description: SiYuan is an open-source personal knowledge management system. In versions 3.6.3 and below, Mermaid diagrams are rendered with securityLevel set to "loose", and the resulting SVG is injected into the DOM via innerHTML. This allows attacker-controlled javascript: URLs in Mermaid code blocks to survive into the rendered output. On desktop builds using Electron, windows are created with nodeIntegration enabled and contextIsolation disabled, escalating the stored XSS to arbitrary code execution when a victim opens a note containing a malicious Mermaid block and clicks the rendered diagram node. This issue has been fixed in version 3.6.4.
- Impact: Attackers can execute arbitrary code on victim's desktop application, leading to full system compromise.
- Remediation: Update to version 3.6.4 or later.
- Vulnerability type: stored_xss
- Vulnerability impact: remote_code_execution, stored_xss
- Requirement type: user_interaction
- Requirements: Victim must open a note with malicious Mermaid block and click the rendered diagram node
- Labels source: projectdiscovery
- Severity: critical
- Cvss score: 9
- Cvss vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H
- Epss score: 0.00312
- Epss percentile: 0.24435
- Assignee: [email protected]
- Published at: 2026-04-16T23:16:33Z
- Age in days: 222
- Modified at: 2026-06-17T10:45:01Z
- Patch available: yes
- References total: 2
- Products total: 1
- Oss: yes
- Projects total: 1
- Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2026-40322
- Nvd status: analyzed
- Checked, none or zero: known exploited entries, nuclei templates, public exploits total, public exploits capped, public exploits, rejected by nvd
- Not known: hackerone
Cwe
| Id | Name |
|---|---|
| CWE-79 | Improper Neutralization of Input During Web Page Generation |
References
| Url | Source | Tags |
|---|---|---|
| https://github.com/siyuan-note/siyuan/security/advisories/GHSA-x63q-3rcj-hhp5 | nvd | Third Party Advisory |
| https://github.com/siyuan-note/siyuan/releases/tag/v3.6.4 | nvd | Release Notes |
Products
| Product | Affected | Platform bound | Sources | Url |
|---|---|---|---|---|
| b3log:siyuan | < 3.6.4 | no | nvd | /v1/products/b3log/siyuan |
Projects
| Repository | Link kinds | Indexed | Url |
|---|---|---|---|
| siyuan-note/siyuan | releases, security_advisory | yes | /v1/repositories/siyuan-note/siyuan |
Index
- Checked, none or zero: repositories, repositories high signal, packages
Exploitation
- Remote: yes
- Authentication required: yes
- Exposed hosts: 354
- Checked, none or zero: known exploited, known exploited by, exploitation seen, public exploit, public exploit count, initial access
- Not known: known exploited since, vulncheck known exploited since, public exploit first date, nuclei template, initial access since, hackerone reports