tags:

views:

202

answers:

2

In the notes for Step 1 in the "How To: Prevent Cross-Site Scripting in ASP.NET" it is stated that you should "not rely on ASP.NET request validation. Treat it as an extra precautionary measure in addition to your own input validation."

Why isn't it enough?

+2  A: 

For one thing, hackers are always coming up with new attacks and new ways of inserting XSS. ASP.NET's RequestValidation only gets updated when a new version of ASP.NET gets released, so if someone comes up with a new attack the day after an ASP.NET release RequestValidation won't catch it.

That (I believe) is one of the reasons why the AntiXSS project appeared, so it can have a faster release cycle.

PhilPursglove
+1 for the AntiXss mention, which everybody should be using.
slugster
+1  A: 

Just two hints:

  • Your application might output not only data that was entered using your ASP.NET forms. Think of web services, RSS feeds, other databases, informations extracted from user uploads etc.

  • Sometimes it's necessary to disable the default (effective but overly simple) request validation because you need to accept angle brackets in your forms. Think of a WYSIWYG editor.

markus