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

This commit is contained in:
dataeaseShu
2026-05-12 11:29:13 +08:00
committed by dataeaseShu
parent 7ac9b5d516
commit 07209cbe45

View File

@@ -76,7 +76,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