Monitor vulnerabilities like this one.
Sign up free to get alerted when software you use is affected.
9.0
SiYuan: Malicious JavaScript in Diagrams Can Execute Code
CVE-2026-40322
Summary
SiYuan versions 3.6.3 and below allow malicious code to be executed when a user interacts with a specially crafted diagram. This can happen if a user opens a note with a malicious diagram and clicks on it. Update to version 3.6.4 to fix this issue.
Original title
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 t...
Original 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.
nvd CVSS3.1
9.0
Vulnerability type
CWE-79
Cross-site Scripting (XSS)
CWE-94
Code Injection
Published: 16 Apr 2026 · Updated: 16 Apr 2026 · First seen: 16 Apr 2026