Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-40322: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in siyuan-note siyuan

0
Critical
VulnerabilityCVE-2026-40322cvecve-2026-40322cwe-79cwe-94
Published: Thu Apr 16 2026 (04/16/2026, 23:00:07 UTC)
Source: CVE Database V5
Vendor/Project: siyuan-note
Product: siyuan

Description

CVE-2026-40322 is a critical cross-site scripting (XSS) vulnerability in SiYuan versions 3. 6. 3 and below. The issue arises because Mermaid diagrams are rendered with securityLevel set to "loose" and injected into the DOM via innerHTML, allowing attacker-controlled javascript: URLs to persist in rendered output. 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. This vulnerability is fixed in version 3. 6. 4.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 04/17/2026, 11:07:48 UTC

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 SVG content via innerHTML. This allows attacker-supplied javascript: URLs in Mermaid code blocks to survive into the rendered SVG output, resulting in stored cross-site scripting. On desktop Electron builds with nodeIntegration enabled and contextIsolation disabled, this stored XSS can escalate to arbitrary code execution when a victim opens a note containing a malicious Mermaid block and clicks the rendered diagram node. The vulnerability is tracked as CVE-2026-40322 with a CVSS 3.1 score of 9.1 (critical) and has been fixed 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 (nodeIntegration enabled and contextIsolation disabled), this can escalate to arbitrary code execution on the victim's system. This can lead to full compromise of the affected host running vulnerable versions of SiYuan prior to 3.6.4.

Mitigation Recommendations

Upgrade SiYuan to version 3.6.4 or later, where this vulnerability has been fixed by changing the Mermaid rendering security settings. Users should ensure they are not running versions 3.6.3 or below. No other mitigations are specified in the advisory.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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/17/2026, 11:07:48 AM

Last updated: 4/17/2026, 12:39:02 PM

Views: 5

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses