How do I HTML Encode all the output in a web application?

前端 未结 11 1515
暖寄归人
暖寄归人 2020-12-10 17:20

I want to prevent XSS attacks in my web application. I found that HTML Encoding the output can really prevent XSS attacks. Now the problem is that how do I HTML encode every

11条回答
  •  无人及你
    2020-12-10 17:28

    If you do actually HTML encode every single output, the user will see plain text of <html> instead of a functioning web app.

    EDIT: If you HTML encode every single input, you'll have problem accepting external password containing < etc..

提交回复
热议问题