mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-03 02:37:02 +00:00
🔒 Do not execute scripts in serving SVG by default to prevent XSS https://github.com/siyuan-note/siyuan/issues/16844
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
@@ -164,6 +164,10 @@ func getDynamicIcon(c *gin.Context) {
|
||||
svg = generateTypeOneSVG(color, lang, dateInfo)
|
||||
}
|
||||
|
||||
if !model.Conf.Editor.AllowSVGScript {
|
||||
svg = util.RemoveScriptsInSVG(svg)
|
||||
}
|
||||
|
||||
c.Header("Content-Type", "image/svg+xml")
|
||||
c.Header("Cache-Control", "no-cache")
|
||||
c.Header("Pragma", "no-cache")
|
||||
|
||||
Reference in New Issue
Block a user