CVE-2026-40107

Publication date

2026-04-09 21:03:58

Family

GitHub_M

State

PUBLISHED

Description

SiYuan is a personal knowledge management system. Prior to 3.6.4, SiYuan configures Mermaid.js with securityLevel: "loose" and htmlLabels: true. In this mode, tags with src attributes survive Mermaids internal DOMPurify and land in SVG blocks. The SVG is injected via innerHTML with no secondary sanitization. When a victim opens a note containing a malicious Mermaid diagram, the Electron client fetches the URL. On Windows, a protocol-relative URL (//attacker.com/image.png) resolves as a UNC path (attacker.comimage.png). Windows attempts SMB authentication automatically, sending the victims NTLMv2 hash to the attacker. This vulnerability is fixed in 3.6.4.