VYPR
High severityNVD Advisory· Published Jan 3, 2025· Updated Jan 3, 2025

SiYuan has an arbitrary file deletion vulnerability

CVE-2025-21609

Description

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.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
github.com/siyuan-note/siyuan/kernelGo
>= 0

Affected products

1

Patches

1
d9887aeec1b2

:lock: Arbitrary file deletion vulnerability https://github.com/siyuan-note/siyuan/issues/13709

https://github.com/siyuan-note/siyuanDanielJan 3, 2025via ghsa
1 file changed · +9 2
  • kernel/model/history.go+9 2 modified
    @@ -18,6 +18,7 @@ package model
     
     import (
     	"encoding/json"
    +	"errors"
     	"fmt"
     	"io/fs"
     	"math"
    @@ -148,6 +149,13 @@ func ClearWorkspaceHistory() (err error) {
     }
     
     func GetDocHistoryContent(historyPath, keyword string, highlight bool) (id, rootID, content string, isLargeDoc bool, err error) {
    +	if !util.IsAbsPathInWorkspace(historyPath) {
    +		msg := "Path [" + historyPath + "] is not in workspace"
    +		logging.LogErrorf(msg)
    +		err = errors.New(msg)
    +		return
    +	}
    +
     	if !gulu.File.IsExist(historyPath) {
     		logging.LogWarnf("doc history [%s] not exist", historyPath)
     		return
    @@ -163,8 +171,7 @@ func GetDocHistoryContent(historyPath, keyword string, highlight bool) (id, root
     	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)
    +		logging.LogErrorf("parse tree from file [%s] failed: %s", historyPath, err)
     		return
     	}
     	id = historyTree.Root.ID
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

4

News mentions

0

No linked articles in our index yet.