平台
go
组件
github.com/siyuan-note/siyuan/kernel
修复版本
3.6.1
0.0.0-20260330031106-f09953afc57a
CVE-2026-34605是SiYuan Kernel中的一个XSS漏洞。在v3.6.0中引入的SanitizeSVG函数旨在修复未经身份验证的/api/icon/getDynamicIcon端点中的XSS,但可以通过使用命名空间前缀的元素名称(例如<x:script xmlns:x="http://www.w3.org/2000/svg">)来绕过。Go HTML5解析器将元素的标签记录为"x:script"而不是"script",因此标签检查会将其传递。SVG以Content-Type: image/svg+xml提供,没有内容安全策略;当浏览器直接打开响应时,其XML解析器将前缀解析为SVG命名空间并执行嵌入的脚本。此问题已在0.0.0-20260330031106-f09953afc57a版本中修复。
Siuan 的 CVE-2026-34605 影响了在版本 3.6.0 中引入的 SanitizeSVG 函数,旨在修复非认证 /api/icon/getDynamicIcon 端点中的 XSS 漏洞。 此函数旨在防止将恶意脚本注入到 SVG 图像中,但可以使用带有命名空间前缀的元素名称(例如 <x:script xmlns:x="http://www.w3.org/2000/svg">)来绕过它。 Go 的 HTML5 解析器将元素标签记录为“x:script”而不是“script”,从而允许过滤器在未检测到的情况下让标签通过。 由于 SVG 以 Content-Type: image/svg+xml 提供且没有内容安全策略 (CSP),因此直接打开响应的浏览器可以执行恶意脚本,从而在用户上下文中执行任意代码。
攻击者可以通过向 /api/icon/getDynamicIcon 端点发送包含具有恶意 JavaScript 代码的 <x:script> 元素的 SVG 恶意请求来利用此漏洞。 如果用户的浏览器没有适当的 CSP,则该脚本将执行,允许攻击者窃取敏感信息、将用户重定向到恶意网站或代表用户执行其他恶意操作。 端点上缺乏身份验证使得此漏洞特别严重,因为任何人都可以利用它。
Users of Siyuan Kernel who are using versions prior to 0.0.0-20260330031106-f09953afc57a are at risk. This includes individuals and organizations relying on Siyuan for note-taking and knowledge management, particularly those who customize the application with custom SVG icons or integrate it with other systems.
• linux / server: Monitor Siyuan Kernel logs for unusual activity related to SVG icon loading. Use journalctl -f to observe real-time log entries. Look for patterns indicating attempts to load or process SVG files with unusual or namespace-prefixed tags.
journalctl -f | grep 'SanitizeSVG' | grep '<x:'• generic web: Examine access logs for requests containing SVG files with namespace-prefixed tags. Use grep to search for patterns like <x:script within the request URI.
grep '<x:script' /var/log/apache2/access.logdisclosure
漏洞利用状态
EPSS
0.13% (32% 百分位)
CISA SSVC
CVE-2026-34605 的修复方法是更新到 Siuan 的补丁版本:0.0.0-20260330031106-f09953afc57a。 此版本更正了 SVG 消毒逻辑,以便无论命名空间前缀如何,都能正确识别 <script> 元素。 作为一种临时缓解措施,建议实施严格的内容安全策略 (CSP),该策略限制从不受信任的来源执行脚本。 此外,还建议审查和审核 Siuan 生成的任何动态图标,以查找潜在的注入。
Actualice SiYuan a la versión 3.6.2 o posterior. Esta versión corrige la vulnerabilidad XSS reflejada en la función SanitizeSVG.
漏洞分析和关键警报直接发送到您的邮箱。
Siuan 中的代码执行漏洞,允许攻击者通过 SVG 图像注入并执行恶意脚本。
如果攻击者利用此漏洞来窃取信息或代表用户执行恶意操作,则用户可能会受到影响。
尽快更新到补丁版本 (0.0.0-20260330031106-f09953afc57a)。
实施严格的内容安全策略 (CSP) 以限制脚本执行。
请参阅 Siuan 关于此漏洞和升级说明的官方公告。
CVSS 向量
上传你的 go.mod 文件,立即知道是否受影响。