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

前端 未结 11 808
旧巷少年郎
旧巷少年郎 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:07

    Take a look at the XSS cheatsheet at http://ha.ckers.org/xss.html it's not a complete list but a good start.

    One that comes to mind is

    You also forgot onmouseover, and the style tag.

    The easiest thing to do really is entity escaping. If the vector can't render properly in the first place, an incomplete blacklist won't matter.

提交回复
热议问题