# CVE-2026-40107: SiYuan Affected by Zero-Click NTLM Hash Theft and Blind SSRF via Mermaid Diagram Rendering

- Priority: **Prioritise**
- Reason: Public exploit (GitHub, Date unknown)
- Next step: Check applicability: affected before 3.6.4 (CNA); fix release not confirmed
- Status: published
- Published: 2026-04-09 · Modified: 2026-04-10
- Aliases: GHSA-w95v-4h65-j455, GO-2026-5702
- Record: https://cvemate.com/vulnerability/CVE-2026-40107 · JSON: https://cvemate.com/vulnerability/CVE-2026-40107/json

## Description

```text
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.
```

## Signals

- CVSS: 8.7 high (v4.0, CVE.org) 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
- EPSS: 0.325%, percentile 27.569%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 1 (github)

## Affected

- b3log siyuan: \< 3.6.4
- github.com/siyuan-note/siyuan kernel (Go): \< 0.0.0-20260407035653-2f416e5253f1
- siyuan-note siyuan: \< 3.6.4

## References

- <https://github.com/siyuan-note/siyuan/security/advisories/GHSA-w95v-4h65-j455>
- <https://nvd.nist.gov/vuln/detail/CVE-2026-40107>
- <https://github.com/siyuan-note/siyuan>

---

Data as of 2026-12-05T08:24:13.297Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
