Friday, 7 October 2016

xss - Input sanitization in ReactJS



I am using ReactJS do develop a simple chat application. Could someone help me to sanitize the input .
There is only one input text box to send chat messages. How to sanitize it?.



              className="chat"

value={this.state.name}
/>


Based on the documentations HTML escapes html by default. Is it enough?. Do I need to add any other sanitization methods. If yes, please let me know how to do that?.


Answer



It's sanitized by default, you don't need a sanitization method unless you are using dangerouslySetInnerHTML which is not the case.


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...