Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:lock: SQL injection security vulnerabilities https://github.com/siyuan-note/siyuan/issues/13077 https://github.com/siyuan-note/siyuan/issues/13058

Danieled33718ddf56
diff --git a/kernel/model/history.go b/kernel/model/history.go
index a91d1c220e..fe6d318faa 100644
--- a/kernel/model/history.go
+++ b/kernel/model/history.go
@@ -473,6 +473,10 @@ func buildSearchHistoryQueryFilter(query, op, box, table string, typ int) (stmt
stmt += " AND op = '" + op + "'"
}
+ if "%" != box && !ast.IsNodeIDPattern(box) {
+ box = "%"
+ }
+
if HistoryTypeDocName == typ || HistoryTypeDoc == typ || HistoryTypeDocID == typ {
if HistoryTypeDocName == typ || HistoryTypeDoc == typ {
stmt += " AND path LIKE '%/" + box + "/%' AND path LIKE '%.sy'"