Skip to content

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

:lock: XSS through emoji name https://github.com/siyuan-note/siyuan/issues/13658

Daniel77efc5cca4df
diff --git a/kernel/api/system.go b/kernel/api/system.go
index b0b5c4376c..14c986b328 100644
--- a/kernel/api/system.go
+++ b/kernel/api/system.go
@@ -162,7 +162,7 @@ func getEmojiConf(c *gin.Context) {
} else {
for _, customEmoji := range customEmojis {
name := customEmoji.Name()
- if strings.HasPrefix(name, ".") {
+ if strings.HasPrefix(name, ".") || strings.Contains(name, "<") {
continue
}
@@ -180,7 +180,7 @@ func getEmojiConf(c *gin.Context) {
}
name = subCustomEmoji.Name()
- if strings.HasPrefix(name, ".") {
+ if strings.HasPrefix(name, ".") || strings.Contains(name, "<") {
continue
}