Open alvawu opened 3 years ago
一样的过滤选项及内容,开发环境和编译后的输出有区别,编译后的第一个白名单标签的起始标签被转义了
xss(html, { whiteList: { h1: ['class'], p: ['class'], box: ['class'], br: [], table: ['cellpadding', 'cellspacing'], tbody: [], tr: [], td: ['width', 'style', 'align'], th: ['width'], span: ['class', 'style'], div: ['class'] }, css: { whiteList: { color: true } } })
html内容:
开发环境正常返回,但build了以后,输出变成了:
这里看起来是后面一个结果中,<h1> 不在白名单中,所以< 和 > 被转义了。
<h1>
<
>
在白名单的第一个是填写了h1标签的
相同的 xss 模块版本和相同的配置,输出结果肯定是一样的,建议再检查一下。
一样的过滤选项及内容,开发环境和编译后的输出有区别,编译后的第一个白名单标签的起始标签被转义了
html内容:
开发环境正常返回,但build了以后,输出变成了: