An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:lock: XSS through emoji name https://github.com/siyuan-note/siyuan/issues/15034 https://github.com/siyuan-note/siyuan/pull/15041
Danield0dbc9b5515e
diff --git a/kernel/api/block.go b/kernel/api/block.goindex 8bf57072e9..c8d31d55fe 100644--- a/kernel/api/block.go+++ b/kernel/api/block.go@@ -626,13 +626,18 @@ func getBlockInfo(c *gin.Context) {}rootTitle := root.IAL["title"]rootTitle = html.UnescapeString(rootTitle)+ icon := root.IAL["icon"]+ if strings.Contains(icon, ".") {+ // XSS through emoji name https://github.com/siyuan-note/siyuan/issues/15034+ icon = util.FilterUploadFileName(icon)+ }ret.Data = map[string]string{"box": block.Box,"path": block.Path,"rootID": block.RootID,"rootTitle": rootTitle,"rootChildID": rootChildID,- "rootIcon": root.IAL["icon"],+ "rootIcon": icon,}}diff --git a/kernel/model/file.go b/kernel/model/file.goindex bd3c51ddf8..3ad04ee94c 100644--- a/kernel/model/file.go+++ b/kernel/model/file.go@@ -80,7 +80,12 @@ func (box *Box) docFromFileInfo(fileInfo *FileInfo, ial map[string]string) (retret.Path = fileInfo.pathret.Size = uint64(fileInfo.size)ret.Name = ial["title"] + ".sy"- ret.Icon = ial["icon"]+ icon := ial["icon"]+ if strings.Contains(icon, ".") {+ // XSS through emoji name https://github.com/siyuan-note/siyuan/issues/15034+ icon = util.FilterUploadFileName(icon)+ }+ ret.Icon = iconret.ID = ial["id"]ret.Name1 = ial["name"]ret.Alias = ial["alias"]