平台
go
组件
github.com/siyuan-note/siyuan/kernel
修复版本
3.6.5
0.0.0-20260407035653-2f416e5253f1
CVE-2026-40107 是一个服务器端请求伪造 (SSRF) 漏洞,存在于 SiYuan Kernel 中。该漏洞源于 Mermaid.js 的配置不当,允许攻击者通过恶意 Mermaid 图表注入 SVG 代码,进而发起 SSRF 攻击。受影响的版本包括 SiYuan 0.0.0 之前的版本。建议用户尽快升级至 0.0.0-20260407035653-2f416e5253f1 以修复此漏洞。
攻击者可以利用此 SSRF 漏洞通过恶意 Mermaid 图表,在受害者打开包含该图表的 SiYuan Note 时,发起服务器端请求。由于 securityLevel: "loose" 和 htmlLabels: true 配置,Mermaid.js 未能有效过滤 <img> 标签,攻击者可以构造包含恶意 src 属性的 <img> 标签,该属性指向攻击者控制的服务器。在 Windows 平台上,使用协议相对 URL (例如 //attacker.com/image.png) 时,会被解析为 UNC 路径 (\\attacker.com\image.png),Windows 会自动尝试 SMB 身份验证,将受害者的 NTLMv2 哈希发送给攻击者,从而导致信息泄露或权限提升。攻击者还可以利用 SSRF 漏洞访问内部服务,扫描内部网络,甚至执行恶意代码。
目前尚未公开发现针对 CVE-2026-40107 的公开利用代码,但由于该漏洞的 SSRF 特性,以及 Mermaid.js 在其他应用中的广泛使用,存在被利用的风险。该漏洞已添加到 CISA KEV 目录,表明其具有中等概率被利用。建议密切关注安全社区的动态,并及时采取缓解措施。
Users of SiYuan who rely on Mermaid diagrams for note-taking and visualization are at risk. Environments with shared hosting or legacy Windows systems with weak SMB configurations are particularly vulnerable, as the automatic NTLMv2 hash transmission poses a significant threat.
• windows / supply-chain: Monitor PowerShell execution for suspicious URLs or SMB connections initiated by the SiYuan process. Use Windows Defender to search for alerts related to network connections to unusual domains or UNC paths.
Get-Process -Name SiYuan | Select-Object -ExpandProperty CommandLine | Select-String -Pattern '\\attacker.com'• linux / server: Examine SiYuan's process logs for any unexpected outbound network connections. Use journalctl to filter for errors or warnings related to Mermaid.js or URL fetching.
journalctl -u siyuan -g 'error' -g 'warning'• generic web: Monitor access logs for requests originating from the SiYuan client to unusual or attacker-controlled domains. Check response headers for unexpected content or redirects. Use curl to test for endpoint exposure.
curl -I https://attacker.com/image.pngdisclosure
漏洞利用状态
EPSS
0.06% (18% 百分位)
CISA SSVC
修复此漏洞的关键是升级至受影响版本之后的修复版本:0.0.0-20260407035653-2f416e5253f1。如果无法立即升级,可以考虑以下临时缓解措施:禁用 Mermaid.js 的 htmlLabels 功能,或者限制允许的 src 协议。此外,可以部署 Web 应用防火墙 (WAF) 或代理服务器,以过滤恶意 Mermaid 图表中的 <img> 标签。在升级后,请验证 Mermaid.js 的配置是否已正确更新,并检查 SiYuan Note 中是否存在恶意 Mermaid 图表。
将 Mermaid.js 库升级到 3.6.4 或更高版本以缓解漏洞。确保配置 `securityLevel: 'strict'` 并禁用 `htmlLabels: true` 以避免通过 Mermaid 图表注入恶意代码。
漏洞分析和关键警报直接发送到您的邮箱。
CVE-2026-40107 是 SiYuan Kernel 中的一个服务器端请求伪造 (SSRF) 漏洞,攻击者可以利用恶意 Mermaid 图表发起 SSRF 攻击。
如果您使用的是 SiYuan 0.0.0 之前的版本,则可能受到此漏洞的影响。请立即升级至 0.0.0-20260407035653-2f416e5253f1。
升级至 0.0.0-20260407035653-2f416e5253f1 是修复此漏洞的最佳方法。
目前尚未公开发现针对 CVE-2026-40107 的公开利用代码,但存在被利用的风险。
请访问 SiYuan 的官方网站或 GitHub 仓库,查找关于 CVE-2026-40107 的安全公告。
上传你的 go.mod 文件,立即知道是否受影响。