mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-28 20:38:49 +01:00
🔒 XSS through emoji name https://github.com/siyuan-note/siyuan/issues/15034 https://github.com/siyuan-note/siyuan/pull/15041
This commit is contained in:
parent
3a991f8075
commit
526e436fbc
3 changed files with 18 additions and 1 deletions
|
|
@ -654,7 +654,12 @@ func setEmoji(c *gin.Context) {
|
|||
argEmoji := arg["emoji"].([]interface{})
|
||||
var emoji []string
|
||||
for _, ae := range argEmoji {
|
||||
emoji = append(emoji, ae.(string))
|
||||
e := ae.(string)
|
||||
if strings.Contains(e, ".") {
|
||||
// XSS through emoji name https://github.com/siyuan-note/siyuan/issues/15034
|
||||
e = util.FilterUploadFileName(e)
|
||||
}
|
||||
emoji = append(emoji, e)
|
||||
}
|
||||
|
||||
model.Conf.Editor.Emoji = emoji
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue