Get a Demo

Let's Patch It!

Book a short call with one our specialists, we'll walk you through how Endor Patches work, and ask you a few questions about your environment (like your primary programming languages and repository management). We'll also send you an email right after you fill out the form, feel free to reply with any questions you have in advance!

CVE

CVE-2026-40322

SiYuan: Mermaid `javascript:` Link Injection Leads to Stored XSS and Electron RCE
Back to all
CVE

CVE-2026-40322

SiYuan: Mermaid `javascript:` Link Injection Leads to Stored XSS and Electron RCE

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.

Package Versions Affected

Package Version
patch Availability
No items found.

Automatically patch vulnerabilities without upgrading

Fix Without Upgrading
Detect compatible fix
Apply safe remediation
Fix with a single pull request

CVSS Version

Severity
Base Score
CVSS Version
Score Vector
C
H
U
9
-
3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H
C
H
U
0
-
3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H
C
H
U
-

Related Resources

No items found.

References

https://github.com/siyuan-note/siyuan/releases/tag/v3.6.4, https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40322.json, https://github.com/siyuan-note/siyuan/security/advisories/GHSA-x63q-3rcj-hhp5, https://nvd.nist.gov/vuln/detail/CVE-2026-40322

Severity

9

CVSS Score
0
10

Basic Information

Base CVSS
9
EPSS Probability
0.00306%
EPSS Percentile
0.23398%
Introduced Version
0
Fix Available
62eed37a3263e3816354beea4041d82419b92b9d

Fix Critical Vulnerabilities Instantly

Secure your app without upgrading.
Fix Without Upgrading