I have my application and from the security testing team I got a bug reported about the possibility for a user to inject malicious code from our forms inputs. The application is developed in ASP.NET MVC4, .NET 4.5 and EF 5.
The attack being tested is like any usual html being entered, but instead of using the regular < or >, my coworker is using < and > (the fullwidth unicode versions of the previous characters: here for the full list). MVC lets these characters get through and then, somehow, the ORM removes the "wide" portion of the character and leaves the standard and plain characters get into the DB. Needless to say that if not correctly encoded in the output of a view, the retrieval and rendering of these characters can lead to XSS vulnerations.
What I need now is a way to sanitize and perform a Normalize() of all the strings being submitted in any form in the application. Some people told me to create a custom model binder, but in the BindModel method I couldn't find a spot to modify the fields so later, the framework could recognize the cleansed values and recognize the injection.
Any suggestion will be much appreciated.