Regarding preventing XSS attacks, HTML encoding when user inputs? HTML encoding when outputting the page? Which solution is better?
天蓬老师
天蓬老师 2017-05-16 12:03:00
0
3
867

For example:
Regarding preventing XSS attacks, should HTML encoding be performed when user input? HTML encoding when outputting the page? Which solution is better?

Personally, I feel that it is more convenient to encode when inputting, because there will be more pages with output content, and it is easy to miss when encoding every time. However, in actual applications, it seems that encoding when outputting is more convenient?

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(3)
过去多啦不再A梦

For xss filtering, remember,
must be filtered on the server side! ! ! ! ! ! !
Be sure to filter when outputting! ! ! ! !

黄舟

Server side: Write the escape of the library and escape when displaying

某草草

I usually escape when typing to prevent SQL injection

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template