Are data URIs on

前端 未结 2 1772
生来不讨喜
生来不讨喜 2021-02-14 12:40

After reading this article I don\'t have a clear answer:

http://palizine.plynt.com/issues/2010Oct/bypass-xss-filters/

  • Will browsers interpret text/html

2条回答
  •  隐瞒了意图╮
    2021-02-14 13:05

    It is possible to inject data in this way, but it is important to note that it is also possible to inject data in the binary data of images themselves. Either way nothing is 100% safe. EVER. If you are using the codeigniter framework, you can very solidly protect yourself from this with

       $this->security->xss_clean()
    

    Other than that could could build your own version of such a script that just removes dangerous things with regex. Remember to be concerned about different character encodings when building such a script.

提交回复
热议问题