CVE-2026-40322
published critical CVSS 3.1 · 9.1SiYuan: Mermaid `javascript:` Link Injection Leads to Stored XSS and Electron RCE
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| siyuan-note | — | siyuan< 3.6.4 | Affected | Not stated | GitHub_M |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 9.1 / 10
- Severity
- critical
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| siyuan-note | siyuan | < 3.6.4 (affected) | GitHub_M · cna |
Weaknesses
2- CWE-79 CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
- CWE-94 CWE-94: Improper Control of Generation of Code ('Code Injection')
References
2Provider assertions
2GitHub_M · cna
SiYuan: Mermaid `javascript:` Link Injection Leads to Stored XSS and Electron RCE
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 6d13ab02dcc7d57f497d6e92cfea49a0feef3576334897a134e7ef3ec28e2d62
- Ingested
- 23 Sep 2026, 09:13:02 UTC
- Source record
- Official CVE record