We have an ASP.NET custom control that lets users enter HTML (similar to a Rich text box). We noticed that a user can potentially inject malicious client scripts within the <script>
tag in the HTML view. I can validate HTML code on save to ensure that I remove any <script>
elements.
Is this all I need to do? Are all other tags other than the <script>
tag safe? If you were an attacker, what else would you attempt to do?
Any best practices I need to follow?
EDIT - How is the MS anti Xss library different from the native HtmlEncode for my purpose?