Quantcast
Channel: Security Vulnerability
Viewing all articles
Browse latest Browse all 317

Alternative to using div.InnerHtml to prevent XSS issues in ASP.NET

$
0
0

Hi,

My existing ASP.NET web application uses a div (set to runat="server") to show disclaimers. This is set using div.InnerHtml property. These disclaimers contain <b>, <br/> tags to show the disclaimers text accordingly. 

ex: disclaimerDiv.InnerHtml = disclaimerMsg;

On veracode submission, these were pointed as potential threats.

I tried using Anti XSS library's Sanitizer.GetSafeHtmlFragment() method, but the required tags were removed.

Is there a better way of doing this? Please advice.

Regards,

Vinod


Viewing all articles
Browse latest Browse all 317

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>