Skip to main content
Live Webinar with SANS (June 25)— Agentic CTI Automation for Fun & ProfitRegister Free
Mallory
Back to intelligence
endpoint-software-vulnerabilitywidely-deployed-product-advisorycredential-access-methodproof-of-concept-release

SiYuan Mermaid Rendering Flaws Expose NTLM Hashes and Enable Electron RCE

Updated 2mo agoFirst seen Apr 9, 20262 sources

GitHub security advisories disclosed two high-severity vulnerabilities in SiYuan that stem from unsafe Mermaid diagram rendering in versions 3.6.3 and earlier. In CVE-2026-40107, SiYuan rendered Mermaid content with securityLevel="loose" and htmlLabels enabled, allowing attacker-controlled img tags to survive sanitization and be injected into SVG foreignObject content through innerHTML. When a victim opens a malicious note, the Electron client can fetch an attacker-controlled URL; on Windows, protocol-relative paths may resolve to UNC shares and trigger automatic SMB authentication, leaking the victim's NTLMv2 hash. The issue was fixed in version 3.6.4 and mapped to CWE-918.

A second flaw, CVE-2026-40322, used the same Mermaid configuration weakness to allow javascript: links to persist in rendered SVG output, creating a stored XSS condition. In SiYuan's Electron desktop application, where nodeIntegration was enabled and contextIsolation disabled, the bug could be escalated to arbitrary code execution if a user opened a malicious note and clicked the rendered diagram node. The vulnerability affects the same pre-3.6.4 release line and is mapped to CWE-79 and CWE-94, with advisory details describing high impact to confidentiality, integrity, and availability.

Share:
SiYuan Mermaid Rendering Flaws Expose NTLM Hashes and Enable Electron RCE
Stay ahead

Get ahead of threats like this

Mallory correlates global threat intelligence with your attack surface — know if you’re exposed before adversaries strike.

EVENT TIMELINE

How this story unfolded

3 events from the most recent confirmed update back to the earliest known activity.

3 EVENTS
Apr 16, 20262mo ago

GitHub advisory discloses CVE-2026-40322 for SiYuan

A GitHub security advisory disclosed CVE-2026-40322, detailing a stored XSS issue in SiYuan's Mermaid rendering that could be escalated to arbitrary code execution in Electron desktop builds. The flaw required a victim to open a malicious note and click a rendered diagram node, and affected version 3.6.3 and earlier.

Apr 9, 20262mo ago

GitHub advisory discloses CVE-2026-40107 for SiYuan

A GitHub security advisory published CVE-2026-40107, describing how malicious Mermaid content in SiYuan could trigger attacker-controlled requests and, on Windows, leak a victim's NTLMv2 hash via automatic SMB authentication to a UNC path. The issue was associated with Mermaid securityLevel set to loose and htmlLabels surviving sanitization.

SiYuan fixes Mermaid rendering flaws in version 3.6.4

SiYuan version 3.6.4 fixed multiple Mermaid-related vulnerabilities, including a zero-click NTLM hash theft and blind SSRF issue as well as a javascript: link injection flaw that could lead to stored XSS and Electron RCE. Both issues affected earlier 3.6.x versions and were tied to insecure Mermaid rendering settings and unsafe DOM injection.

LINKED ENTITIES

Related entities

Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.

5 LINKEDOpen in app
Vulnerabilities
1 linked
Affected products
3 linked
WindowsElectronSiyuan
Organizations
1 linked
SiYuan
The operational view lives in Mallory

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t — which of your assets are affected, which threat actors are using it right now, which detections to deploy, and what to do next.
Exposure mapping

Map indicators from this story to your assets and identify affected systems in minutes.

Threat actor evidence

Every observed campaign, victim, and pivot linked to actors named in this story.

Associated malware

Malware, exploits, and IOCs connected to the activity described here.

Detection signatures

YARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.

Scheduled alerts

Get matching new stories delivered to your team as they break — not the next morning.

AI threads

Ask questions about this story and take action on the answers.

SiYuan Mermaid Rendering Flaws Expose NTLM Hashes and Enable Electron RCE | Mallory