java - GWT - XSS prevention and rendering safe/simple html -
i know best ways prevent xss in gwt app while still providing way users edit , view custom html (for ex. rich text editor).
specifically, if user tries store evil hidden code in public entity meant viewed html other users, make sure evil html not executed.
example:
<img src=a onerror="alert('evil');"> <br> <b>test1</b> <font>test2</font>
in code, allow <br>
, <b>
, <font>
tags , <img>
, want strip javascript. tried testing safehtml utility classes but: safehtmlbuilder , safehtmlutils escaping tags (so form first name, last name, not when rendering text rich text editor right?) , simplehtmlsanitizer has few allowed tags.
my question is, there way achieve in gwt (protecting "good" users "bad" when rendering html) or must text processing should done on server-side ?
this htmlsanitizer
for. simplehtmlsanitizer
might bit simple use case can serve basis build own.
Comments
Post a Comment