Getting error when trying to save or publish in 4.5.2 (A potentially dangerous Request.Form value was detected from the client).
I'm getting an error when I try to save or save and publish a document on a 4.5.2 site. I'm not sure what this is occurring. There is a rich text editor control on the node and it doesn't seem to like it. This is the error and stack trace I'm getting:
A potentially dangerous Request.Form value was detected from the client (ctl00$body$content="<p>It's not often a ...").
Stack Trace:
[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (ctl00$body$content="<p>It's not often a ...").]
Do you get this when you're saving content within the umbraco backend? Or do you create the content using a form in a user control using the umbraco API?
But I have not heard of this happening in v4.5 before...is it an upgrade from v4.x.x to 4.5.2 you're using? Maybe that can explain it? There should be some solutions you can try out in the posted link.
It's on the backend, when trying to "Save" or "Save and Publish". I've read this and the offending page seems to be "/umbraco/editContent.aspx", but that page already has ValidateRequest="false" set in the <%@ Page %> section by default. It was an upgrade from 4.5.1 to 4.5.2. Again, I'm not sure what is going on :-/
This is running on a shared host (SoftSys Hosting) in full trust mode, so I don't have control over the permissions of the network service or the iusr account. It's not running in integrated mode.
I can set it to integrated, but then I get a whole new set of issues. Some of the CSS files on the backend don't load and things just look crazy and unstyled. Previously I had issues running in integrated mode on this host and they told me the web.config was not configured correctly to support integrated mode. I didn't know that there was a need to change the web.config to specifically support integrated mode.
I haven't contacted support about this yet because it seemed more like an Umbraco specific related bug to me, but then again I may be wrong, hehe.
Ok, then you should probably not set it to integrated mode afterall.
I must admit this is the first time I hear about the issue on a 4.5.2 installation so I suspect it can maybe the hosting setup somehow...but I'm not certain.
Maybe some of the gurus in here have some greater pointers and advice than me. I hope you get this annoying problem solved :-)
Well, I have a ton of Umbraco sites running on the same host and have yet to experience the same issue I am here, which is why I think it probably isn't the host. To be honest, I'm at a loss here. :-/ Thanks for your help though :)
After reading the reply of Bas in the post below I think that you should get clarified if there is any differences in the permission settings etc. on this particular site and the others you have on the same host that is running without any problems. According to Bas there were some trouble with the permissions setting and IIS.
Hmm, that doesn't seem to help me. I don't have control over the permissions of the site (other than to enable Write Permissions, which are enabled). It's also set to the correct version (4.0). I'll have to contact their tech support and see if they have any clue as to what is going on.
Just in case anyone else is getting this, there is one other thing to be aware of - umbraco/members/EditMember.aspx does NOT have ValidateRequest="false" set on it, so if you are using the Umbraco Member Provider to set up rich content on your members, you may well run into this.
Just add ValidateRequest="false" to the @Page tag of umbraco/members/EditMember.aspx.
Getting error when trying to save or publish in 4.5.2 (A potentially dangerous Request.Form value was detected from the client).
I'm getting an error when I try to save or save and publish a document on a 4.5.2 site. I'm not sure what this is occurring. There is a rich text editor control on the node and it doesn't seem to like it. This is the error and stack trace I'm getting:
A potentially dangerous Request.Form value was detected from the client (ctl00$body$content="<p>It's not often a ...").
Stack Trace:
[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (ctl00$body$content="<p>It's not often a ...").]
System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection) +8734868
System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, RequestValidationSource requestCollection) +122
System.Web.HttpRequest.get_Form() +114
System.Web.HttpRequest.get_HasForm() +8900239
System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +97
System.Web.UI.Page.DeterminePostBackMode() +69
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8431
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +253
System.Web.UI.Page.ProcessRequest() +78
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.umbraco_editcontent_aspx.ProcessRequest(HttpContext context) +4
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
Hi Michael
Do you get this when you're saving content within the umbraco backend? Or do you create the content using a form in a user control using the umbraco API?
/Jan
Hmmm it seems like this has been a bug in the initial release of Umbraco 4 - Here's the work item on codeplex: http://umbraco.codeplex.com/workitem/21491?ProjectName=umbraco
But I have not heard of this happening in v4.5 before...is it an upgrade from v4.x.x to 4.5.2 you're using? Maybe that can explain it? There should be some solutions you can try out in the posted link.
/Jan
It's on the backend, when trying to "Save" or "Save and Publish". I've read this and the offending page seems to be "/umbraco/editContent.aspx", but that page already has ValidateRequest="false" set in the <%@ Page %> section by default. It was an upgrade from 4.5.1 to 4.5.2. Again, I'm not sure what is going on :-/
Hmmm
Do you know if you're using the ASP.NET 3.5 or ASP.NET 4?
/Jan
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
Ok then...
I must admit that I'm also a bit lost here...
But hey...let's take a long shot...
What permissions have you given network service and the iusr? And is the app pool running in integrated mode?
/Jan
This is running on a shared host (SoftSys Hosting) in full trust mode, so I don't have control over the permissions of the network service or the iusr account. It's not running in integrated mode.
Thanks :)
Ah ok...well have you tried to contact support about it then?
Is it possible for you to try and set it to run integrated mode to see what happens? Or do you need to ask supprt to do that?
/Jan
I can set it to integrated, but then I get a whole new set of issues. Some of the CSS files on the backend don't load and things just look crazy and unstyled. Previously I had issues running in integrated mode on this host and they told me the web.config was not configured correctly to support integrated mode. I didn't know that there was a need to change the web.config to specifically support integrated mode.
I haven't contacted support about this yet because it seemed more like an Umbraco specific related bug to me, but then again I may be wrong, hehe.
Hi Michael
Ok, then you should probably not set it to integrated mode afterall.
I must admit this is the first time I hear about the issue on a 4.5.2 installation so I suspect it can maybe the hosting setup somehow...but I'm not certain.
Maybe some of the gurus in here have some greater pointers and advice than me. I hope you get this annoying problem solved :-)
/Jan
Well, I have a ton of Umbraco sites running on the same host and have yet to experience the same issue I am here, which is why I think it probably isn't the host. To be honest, I'm at a loss here. :-/ Thanks for your help though :)
Hi again Michael
After reading the reply of Bas in the post below I think that you should get clarified if there is any differences in the permission settings etc. on this particular site and the others you have on the same host that is running without any problems. According to Bas there were some trouble with the permissions setting and IIS.
http://our.umbraco.org/forum/using/ui-questions/15846-SystemWebHttpRequestValidationException-after-publishing-a-page?p=0#comment58525
/Jan
Hmm, that doesn't seem to help me. I don't have control over the permissions of the site (other than to enable Write Permissions, which are enabled). It's also set to the correct version (4.0). I'll have to contact their tech support and see if they have any clue as to what is going on.
Thanks!
I've contacted tech support at my host and they seem to think it's not the server. Anyone else have any ideas of what it could possibly be?
Thanks!
I'm pulling my hair out here. I can't seem to figure out why this error is still showing up. Anyone have any more ideas?
I figured it out. My web.config file was missing the requestValidationMode="2.0" from the httpruntime node. Adding that fixed it! :)
Thanks for posting your solution Michael! This line of code in the web.config helped me out as well.
I ran into the same problem when upgrading from umbraco 4.5.2 to 4.7 and from .NET 3.5 to .NET 4.0.
Just in case anyone else is getting this, there is one other thing to be aware of - umbraco/members/EditMember.aspx does NOT have ValidateRequest="false" set on it, so if you are using the Umbraco Member Provider to set up rich content on your members, you may well run into this.
Just add ValidateRequest="false" to the @Page tag of umbraco/members/EditMember.aspx.
try add
is working on a reply...