# CVE-2026-40322: SiYuan: Mermaid \`javascript:\` Link Injection Leads to Stored XSS and Electron RCE

- Priority: **Prioritise**
- Reason: Severe, CVSS 9.1 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 0% (FIRST, 04-12-2026)
- Next step: Check applicability: affected before 3.6.4 (CNA); fix release not confirmed
- Status: published
- Published: 2026-04-16 · Modified: 2026-04-17
- Record: https://cvemate.com/vulnerability/CVE-2026-40322 · JSON: https://cvemate.com/vulnerability/CVE-2026-40322/json

## Description

```text
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.
```

## Signals

- CVSS: 9.1 critical (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H
- EPSS: 0.318%, percentile 26.737%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- b3log siyuan: \< 3.6.4
- siyuan-note siyuan: \< 3.6.4

## References

- <https://github.com/siyuan-note/siyuan/security/advisories/GHSA-x63q-3rcj-hhp5>
- <https://github.com/siyuan-note/siyuan/releases/tag/v3.6.4>

---

Data as of 2026-12-05T08:15:49.142Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
