fix(漏洞): XSS:多处 v-html 渲染用户可控内容

This commit is contained in:
dataeaseShu
2026-05-12 11:29:13 +08:00
committed by dataeaseShu
parent 90972121fd
commit 0de0ea7180

View File

@@ -77,7 +77,10 @@ export const setColorName = (obj, keyword: string, key?: string, colorKey?: stri
keyword +
'</span>' +
name.substring(index + keyword.length, name.length)
obj[colorKey] = textCode
obj[colorKey] = DOMPurify.sanitize(textCode, {
ALLOWED_TAGS: ['span'],
ALLOWED_ATTR: ['class']
})
return
}
obj[colorKey] = null