Why use a whitelist for HTML sanitizing?

前端 未结 7 2165
野趣味
野趣味 2020-12-06 18:39

I\'ve often wondered -- why use a whitelist as opposed to a blacklist when sanitizing HTML input?

How many sneaky HTML tricks are there to open XSS vulnerabilities?

7条回答
  •  时光说笑
    2020-12-06 18:57

    Even though script tags and frame tags are not allowed, you still can put any tag like this

    mouse over this
    

    and many browsers works.

提交回复
热议问题