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…
EPSS 0.1%top 83%

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

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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 04/24/2026, 16:21:16 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 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.

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/24/2026, 4:21:16 PM

Last updated: 5/31/2026, 12:52:39 PM

Views: 108

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