CVE-2026-40322: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in siyuan-note siyuan
SiYuan versions 3. 6. 3 and below have a critical stored cross-site scripting (XSS) vulnerability due to insecure rendering of Mermaid diagrams with securityLevel set to "loose". This allows attacker-controlled javascript: URLs to be injected into the DOM. On desktop Electron builds with nodeIntegration enabled and contextIsolation disabled, this XSS can escalate to arbitrary code execution when a user interacts with a malicious Mermaid diagram. The issue is fixed in version 3. 6. 4.
AI Analysis
Technical Summary
SiYuan, an open-source personal knowledge management system, versions 3.6.3 and earlier render Mermaid diagrams insecurely by setting securityLevel to "loose" and injecting the resulting SVG into the DOM via innerHTML. This permits attacker-controlled javascript: URLs in Mermaid code blocks to persist in the rendered output, leading to stored cross-site scripting (CWE-79). In desktop Electron builds where nodeIntegration is enabled and contextIsolation is disabled, this stored XSS can escalate to arbitrary code execution (CWE-94) when a victim opens a note containing a malicious Mermaid block and clicks the rendered diagram node. The vulnerability has been addressed in version 3.6.4.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary JavaScript code within the context of the SiYuan application. On desktop Electron builds with insecure configurations, this can escalate to arbitrary code execution on the victim's machine. The vulnerability affects confidentiality, integrity, and availability, as indicated by the CVSS vector (C:H/I:H/A:H). No known exploits in the wild have been reported.
Mitigation Recommendations
Upgrade SiYuan to version 3.6.4 or later, where this vulnerability is fixed. Since the vendor advisory confirms the issue is resolved in 3.6.4, applying this official fix is the recommended remediation. No additional mitigations are specified.
CVE-2026-40322: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in siyuan-note siyuan
Description
SiYuan versions 3. 6. 3 and below have a critical stored cross-site scripting (XSS) vulnerability due to insecure rendering of Mermaid diagrams with securityLevel set to "loose". This allows attacker-controlled javascript: URLs to be injected into the DOM. On desktop Electron builds with nodeIntegration enabled and contextIsolation disabled, this XSS can escalate to arbitrary code execution when a user interacts with a malicious Mermaid diagram. The issue is fixed in version 3. 6. 4.
CVSS v3.1
Score 9.1critical
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
SiYuan, an open-source personal knowledge management system, versions 3.6.3 and earlier render Mermaid diagrams insecurely by setting securityLevel to "loose" and injecting the resulting SVG into the DOM via innerHTML. This permits attacker-controlled javascript: URLs in Mermaid code blocks to persist in the rendered output, leading to stored cross-site scripting (CWE-79). In desktop Electron builds where nodeIntegration is enabled and contextIsolation is disabled, this stored XSS can escalate to arbitrary code execution (CWE-94) when a victim opens a note containing a malicious Mermaid block and clicks the rendered diagram node. The vulnerability has been addressed in version 3.6.4.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary JavaScript code within the context of the SiYuan application. On desktop Electron builds with insecure configurations, this can escalate to arbitrary code execution on the victim's machine. The vulnerability affects confidentiality, integrity, and availability, as indicated by the CVSS vector (C:H/I:H/A:H). No known exploits in the wild have been reported.
Mitigation Recommendations
Upgrade SiYuan to version 3.6.4 or later, where this vulnerability is fixed. Since the vendor advisory confirms the issue is resolved in 3.6.4, applying this official fix is the recommended remediation. No additional mitigations are specified.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-04-10T21:41:54.505Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 69e2142282d89c981fcd7cf5
Added to database: 4/17/2026, 11:06:10 AM
Last enriched: 4/24/2026, 4:21:16 PM
Last updated: 5/31/2026, 12:52:39 PM
Views: 108
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.