Does this set of regular expressions FULLY protect against cross site scripting?

前端 未结 11 803
旧巷少年郎
旧巷少年郎 2020-12-13 11:35

What\'s an example of something dangerous that would not be caught by the code below?

EDIT: After some of the comments I added another line, commented below. See V

11条回答
  •  無奈伤痛
    2020-12-13 12:16

    You're much better off turning all < into < and all > into >, then converting acceptable tags back. In other words, whitelist, don't blacklist.

提交回复
热议问题