Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果从文本中删除所有标签,是否可以执行 XSS 攻击?标签表示匹配模式“<...>”(正则表达式:)的所有内容/<.*?>/g。
/<.*?>/g
是的:
<img src=x onerror=alert(1)//
不要发明自己的过滤器。如 OWASP XSS 预防备忘单中所述对上下文进行编码。