{"id":502,"date":"2003-09-16T21:43:00","date_gmt":"2003-09-17T01:43:00","guid":{"rendered":"http:\/\/wordpress.cephas.net\/?p=502"},"modified":"2003-09-16T21:43:00","modified_gmt":"2003-09-17T01:43:00","slug":"aspnet-request-validation-preventing-script-attacks","status":"publish","type":"post","link":"https:\/\/cephas.net\/blog\/2003\/09\/16\/aspnet-request-validation-preventing-script-attacks\/","title":{"rendered":"ASP.NET Request Validation &#8211; Preventing Script Attacks"},"content":{"rendered":"<p>Yesterday I was working with self posting form that contained html characters as of a content management implementation using ASP.NET and I came across an error message I&#8217;d not seen from any application server. It said:<\/p>\n<p>&#8220;A potentially dangerous Request.Form value was detected from the client..&#8221;<\/p>\n<p>In short, as of ASP.NET 1.1, Microsoft is by <b>default<\/b> not allowing clients to post client script code or HTML to a form.  As a developer,  you have to either explicitly allow it for a page by including this:<\/p>\n<p>&lt;%@ Page validateRequest=&#8221;false&#8221;  %&gt;<\/p>\n<p>in your ASP.NET page or by turning it off sitewide in the web.config file:<\/p>\n<p>&lt;configuration&gt;<br \/>\n&nbsp;&nbsp;&lt;system.web&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;pages validateRequest=&#8221;false&#8221; \/&gt;<br \/>\n&nbsp;&nbsp;&lt;\/system.web&gt;<br \/>\n&lt;\/configuration&gt;<\/p>\n<p>Automatic request validation, in my humble opinion, is pretty nice.  Way to go Microsoft.  You can read more about <a href=\"http:\/\/www.asp.net\/faq\/RequestValidation.aspx\">this feature<\/a> on the official <a href=\"http:\/\/www.asp.net\/\">ASP.NET site<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday I was working with self posting form that contained html characters as of a content management implementation using ASP.NET and I came across an error message I&#8217;d not seen from any application server. It said: &#8220;A potentially dangerous Request.Form value was detected from the client..&#8221; In short, as of ASP.NET 1.1, Microsoft is by &hellip; <a href=\"https:\/\/cephas.net\/blog\/2003\/09\/16\/aspnet-request-validation-preventing-script-attacks\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">ASP.NET Request Validation &#8211; Preventing Script Attacks<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"tags":[],"_links":{"self":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/502"}],"collection":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/comments?post=502"}],"version-history":[{"count":0,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/502\/revisions"}],"wp:attachment":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/media?parent=502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/categories?post=502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/tags?post=502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}