Auto exposure Asp.Net MVC

In Asp.net Mvc, all line output is not saved by default, either you remember that you avoid everything with HTTPUtility, or you open yourself up for XSS attacks.

Now I am a forgetful guy, so I am looking for a solution that helps me “forget” to avoid all my lines for me.

Can anyone use any of the tricks they used make it easy to execute all the Asp.net MVC output?

+3
source share
2 answers

jfar, what you want is absolutely possible, see this great blog post:

http://blog.codeville.net/2007/12/19/aspnet-mvc-prevent-xss-with-automatic-html-encoding/

, "<% =.... > "; , GenerateCodeFromStatement() CSharpCodeProvider, . HttpUtility.HtmlEncode asp.net mvc.

+2

, , "" MVC, : , , , - .

MVCContrib, FluentHtml; , .

0

Source: https://habr.com/ru/post/1715772/


All Articles