Описание
SiYuan vulnerable to Arbitrary file Read / SSRF
Summary
Markdown feature allows unrestricted server side html-rendering which allows arbitary file read (LFD) and fully SSRF access We in @0xL4ugh ( @abdoghazy2015, @xtromera, @A-z4ki, @ZeyadZonkorany and @KarimTantawey) During playing Null CTF 2025 that helps us solved a challenge with unintended way : )
Please note that we used the latest Version and deployed it via this dockerfile :
Dockerfile:
startup.sh
docker-compose.yaml:
Details
As you can see here : https://github.com/siyuan-note/siyuan/blob/v3.4.2/kernel/api/filetree.go#L799-L886
in createDocWithMd function
the markdown parameter is being passed to the model.CreateWithMarkdown without any sanitization
while here : https://github.com/siyuan-note/siyuan/blob/master/kernel/model/file.go#L1035 the input is being passed to luteEngine.Md2BlockDOM(md, false) without any sanitization too
PoC
Here is a full Python POC ready to run
File read
SSRF :
We spawned a python server at /tmp : 4444 and requested it the result is we could successfuly read a file from http://127.0.0.1/ghazy
Impact
As shown above, we could sucessfully read any file in the system and reach any internal host via SSRF : )
Solution
Ссылки
- https://github.com/siyuan-note/siyuan/security/advisories/GHSA-cv54-7wv7-qxcw
- https://nvd.nist.gov/vuln/detail/CVE-2026-23850
- https://github.com/siyuan-note/siyuan/issues/16860
- https://github.com/siyuan-note/siyuan/commit/b2274baba2e11c8cf8901b0c5c871e5b27f1f6dd
- https://github.com/siyuan-note/siyuan/commit/f8f4b517077b92c90c0d7b51ac11be1b34b273ad
- https://github.com/siyuan-note/siyuan/blob/master/kernel/model/file.go#L1035
- https://github.com/siyuan-note/siyuan/blob/v3.4.2/kernel/api/filetree.go#L799-L886
Пакеты
github.com/siyuan-note/siyuan/kernel
< 0.0.0-20260118092326-b2274baba2e1
0.0.0-20260118092326-b2274baba2e1
Связанные уязвимости
SiYuan is a personal knowledge management system. In versions prior to 3.5.4, the markdown feature allows unrestricted server side html-rendering which allows arbitrary file read (LFD). Version 3.5.4 fixes the issue.