A potentially dangerous Request.Cookies value was detected from the client...

Last post 09-09-2008 2:09 PM by mmorse. 2 replies.

Sort Posts:

  • A potentially dangerous Request.Cookies value was detected from the client...

    09-09-2008, 11:01 AM
    • Member
      point Member
    • mmorse
    • Member since 09-09-2008, 10:47 AM
    • Posts 2

    Hi, I am new to ajax and asp.net.  Recently I developed two pages, SearchBox and QResults.  SearchBox takes a search term along with some other information and sends it to QResults which has an ajax Accordion and also in some cases dynamically creates a few Accordions.  I only use javascript to create a cookie which is used on SearchBox, since the QResults are in a frame on the page and don't have much experience.  The javascript cookies have been used for quite some time and this issue has never come up.  I don't use Request.Cookies on either page.  The <pages requestValidate="true"> and I am running asp.net 2.0. 

    Users are randomly getting this error and it is solved when they clear their cookies and/or temporary internet files.  I have yet to be able to locally reproduce the error.  Below is the error that I am seeing on our PROD server.  I would like to thank anyone in advance for taking the time to read this. 

     

    Exception information:

    Exception type: HttpRequestValidationException

    Exception message: A potentially dangerous Request.Cookies value was detected from the client (FIIBG010599="...a/cKiZ2Os=<IVParms>BAgd5rinhjv...").

     

    Request information:

    Request URL: ...
    /QResults.aspx?view=home&query=vru&type=all

    Request path: .../QResults.aspx

    Is authenticated: True

    Authentication Type: Negotiate

    Thread account name: NT AUTHORITY\NETWORK SERVICE

     

    Thread information:

    Thread ID: 1

    Thread account name: NT AUTHORITY\NETWORK SERVICE

    Is impersonating: False

    Stack trace: at System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName)

    at System.Web.HttpRequest.ValidateCookieCollection(HttpCookieCollection cc)

    at System.Web.HttpRequest.get_Cookies()

    at System.Web.HttpRequest.FillInParamsCollection()

    at System.Web.HttpRequest.GetParams()

    at System.Web.HttpRequest.get_Params()

    at AjaxControlToolkit.ToolkitScriptManager.OutputCombinedScriptFile(HttpContext context) in C:\Program Files\Microsoft ASP.NET\AjaxControlToolkit\ToolkitScriptManager\ToolkitScriptManager.cs:line 215

    at AjaxControlToolkit.ToolkitScriptManager.OnInit(EventArgs e) in C:\Program Files\Microsoft ASP.NET\AjaxControlToolkit\ToolkitScriptManager\ToolkitScriptManager.cs:line 197

    at System.Web.UI.Control.InitRecursive(Control namingContainer)

    at System.Web.UI.Control.InitRecursive(Control namingContainer)

    at System.Web.UI.Control.InitRecursive(Control namingContainer)

    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    at System.Web.UI.Page.ProcessRequest()

    at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)

    at System.Web.UI.Page.ProcessRequest(HttpContext context)

    at ASP.qresults_aspx.ProcessRequest(HttpContext context) in c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\etc_search\921ac670\38d2a38b\App_Web_sxwblpo4.1.cs:line 0

    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

  • Re: A potentially dangerous Request.Cookies value was detected from the client...

    09-09-2008, 1:21 PM
    Answer
    • Star
      8,978 point Star
    • dwhite
    • Member since 02-08-2007, 2:25 PM
    • Bristol, CT
    • Posts 1,422

    Try setting ValidateRequest to false in your page directive, see http://forums.asp.net/t/577973.aspx

    -Damien

    Visoft, Inc - Home | Blogs

    Latest Blog Post: Silverlight DataBinding Bug
  • Re: A potentially dangerous Request.Cookies value was detected from the client...

    09-09-2008, 2:09 PM
    • Member
      point Member
    • mmorse
    • Member since 09-09-2008, 10:47 AM
    • Posts 2

    Thank you for the response.  It's hard for me to test this because I can't reproduce it.  Do you know of any way that I could reproduce this or give any insight as to why I'm getting this error?  I think it looks like <IVParms> is giving the cookie error but how is that getting stored in there or where is that coming from?

Page 1 of 1 (3 items)