Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use the Anti-XSS Security Runtime Engine in ASP.NET MVC?

I have been reading up on Anti-XSS Security Runtime Engine and it looks like a nice solution for web forms because it inspects controls via reflection and automatically encodes data where appropriate. However as I don't really use server side controls in ASP.NET MVC, it does not seem to be a viable solution for ASP.NET MVC. Is this correct or am I missing something?

like image 974
Blegger Avatar asked Jun 16 '09 20:06

Blegger


People also ask

What is XSS attack in mvc?

Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into otherwise benign and trusted websites. XSS attacks occur when an attacker uses a web application to send malicious code, generally in the form of a browser side script, to a different end user.

Why is security so critical when developing online applications particularly with ASP NET?

This is because if your application is not tested and validated against security threats right from the initial stages of development, it may fail to protect valuable corporate data and resources from malicious attacks.


2 Answers

The Anti-XSS Security Runtime Engine is an HTTP Module primarily designed around updating legacy ASP.NET applications. If you've already written the ASP.NET MVC application with proper data cleansing with the built in HTML Helpers (i.e. Html.Encode()), then the Anti-XSS Engine adds nothing new, and requires additional configuration (for necessary white-lists) and error checking.

All in all, you should not rely on the Anti-XSS Engine, especially if you rely on explicit control of when input is and is not rendered as HTML.

like image 135
Jon Avatar answered Sep 25 '22 14:09

Jon


Phil Haack has an interesting blog post here http://haacked.com/archive/2009/02/07/take-charge-of-your-security.aspx. He suggests using Anti-XSS combined with CAT.NET.

like image 41
RichardOD Avatar answered Sep 23 '22 14:09

RichardOD