To HTMLENCODE or not to HTMLENCODE user input on web form (asp.net vb)

Posted by Phil on Stack Overflow See other posts from Stack Overflow or by Phil
Published on 2010-06-03T08:48:37Z Indexed on 2010/06/03 8:54 UTC
Read the original article Hit count: 374

Filed under:
|
|
|
|

I have many params making up an insert form for example:

x.Parameters.AddWithValue("@city", City.Text)

I had a failed xss attack on the site this morning, so I am trying to beef up security measures anyway....

Should I be adding my input params like this?

x.Parameters.AddWithValue("@city", HttpUtility.HtmlEncode(City.Text))

Is there anything else I should consider to avoid attacks?

Thanks

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about security