mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 16:10:12 +01:00
🔒 XSS through emoji name https://github.com/siyuan-note/siyuan/issues/15034
This commit is contained in:
parent
a9ae243baf
commit
db18639080
1 changed files with 2 additions and 2 deletions
|
|
@ -165,7 +165,7 @@ func getEmojiConf(c *gin.Context) {
|
||||||
} else {
|
} else {
|
||||||
for _, customEmoji := range customEmojis {
|
for _, customEmoji := range customEmojis {
|
||||||
name := customEmoji.Name()
|
name := customEmoji.Name()
|
||||||
if strings.HasPrefix(name, ".") || strings.Contains(name, "<") {
|
if strings.HasPrefix(name, ".") || strings.ContainsAny(name, "<\"") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -183,7 +183,7 @@ func getEmojiConf(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
name = subCustomEmoji.Name()
|
name = subCustomEmoji.Name()
|
||||||
if strings.HasPrefix(name, ".") || strings.Contains(name, "<") {
|
if strings.HasPrefix(name, ".") || strings.ContainsAny(name, "<\"") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue