CVE-2026-40107

SiYuan Affected by Zero-Click NTLM Hash Theft and Blind SSRF via Mermaid Diagram Rendering

Published Apr 9, 2026 CVSS 4.0 · 8.7 High EPSS < 1% KEV · Not listed
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, <img> tags with src attributes survive Mermaid's internal DOMPurify and land in SVG <foreignObject> 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.com\image.png). Windows attempts SMB authentication automatically, sending the victim's NTLMv2 hash to the attacker. This vulnerability is fixed in 3.6.4.

Analysis

AI-generated

Technical impact

SiYuan, a personal knowledge management system, allows Mermaid diagrams to be rendered with settings that enable HTML labels and a ‘loose’ security level. In this configuration <img> tags can escape the internal DOMPurify filter and end up inside SVG foreignObject blocks. The SVG content is injected into the page using innerHTML without additional sanitization, leading to a zero‑click vulnerability. When a user opens a note containing a malicious Mermaid diagram, the Electron client automatically fetches the image URL. On Windows, a protocol‑relative URL such as //attacker.com/image.png resolves to a UNC path, which triggers SMB authentication and causes Windows to send the victim’s NTLMv2 hash to the target. The attacker can capture this credential and later use it in pass‑the‑hash attacks or other credential‑based exploitation scenarios.

Affected Systems

The issue affects the SiYuan application version 3.6.3 and earlier. The vulnerable component is the Electron client running on Windows operating systems. The affected environment includes any user who opens a note containing a Mermaid diagram with an image reference that can resolve to a UNC path. The vendor product is Siyuan-Note Siyuan.

Risk and Exploitability

The CVSS score for this vulnerability is 8.7, indicating high severity. While an EPSS score is not provided, the zero‑click nature and the ability to exfiltrate NTLM hashes without user interaction suggest a high likelihood of exploitation in environments where users work with potentially untrusted content. The vulnerability is not currently listed in the CISA KEV catalog. Attacks require only the user to open a malicious note; no additional permissions or input are necessary beyond normal use of the application.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade SiYuan to version 3.6.4 or later.

Generated by OpenCVE AI on April 9, 2026 at 22:52 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-w95v-4h65-j455 SiYuan Affected by Zero-Click NTLM Hash Theft and Blind SSRF via Mermaid Diagram Rendering
History
Type Values Removed Values Added
First Time appeared B3log
B3log siyuan
CPEs cpe:2.3:a:b3log:siyuan:*:*:*:*:*:*:*:*
Vendors & Products B3log
B3log siyuan
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N'}

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Siyuan
Siyuan siyuan
Vendors & Products Siyuan
Siyuan siyuan
Type Values Removed Values Added
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, <img> tags with src attributes survive Mermaid's internal DOMPurify and land in SVG <foreignObject> 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.com\image.png). Windows attempts SMB authentication automatically, sending the victim's NTLMv2 hash to the attacker. This vulnerability is fixed in 3.6.4.
Title SiYuan Affected by Zero-Click NTLM Hash Theft and Blind SSRF via Mermaid Diagram Rendering
Weaknesses CWE-918
References
Metrics cvssV4_0

{'score': 8.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:L/SI:L/SA:N'}

Weaknesses
  • CWE-918

    Server-Side Request Forgery (SSRF)

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Apr 10, 2026, 6:12 PM
Reserved
Apr 9, 2026, 1:41 AM
Status
Analyzed
Published
Apr 9, 2026, 9:16 PM
Modified
Jun 17, 2026, 10:44 AM