mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-29 03:36:10 +01: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:
parent
dbeb703ad1
commit
5c0cc375b4
1 changed files with 4 additions and 0 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue