A potentially dangerous Request.Path value was detected from the client (<). Getting exception from framework pipline

-1

I am getting following exception on appending dodgy value in Api url.

I've tried a lot of different suggestions from other stack overflow questions, like 1 and 2. However, adding this to my Web.config doesn't work:

Here is error stack trace details:

[HttpException (0x80004005): A potentially dangerous Request.Path value was detected from the client (<).] System.Web.HttpRequest.ValidateInputIfRequiredByConfig() +678 System.Web.PipelineStepManager.ValidateHelper(HttpContext context) +52

asp.net
asp.net-mvc
asked on Stack Overflow Jan 13, 2020 by Kunal Chhabra • edited Jan 14, 2020 by Kunal Chhabra

1 Answer

-1

There is a solution in one of the stack overflow link. It might help to resolve your issue.

or you can simply update your web.config's system.web attribute as below

<system.web>
    <httpRuntime requestPathInvalidCharacters="<,>" requestValidationMode="2.0" />
    <pages validateRequest="false" />
</system.web>

or if you use .NET 4.0 then simple put

<system.web>
    <httpRuntime requestValidationMode="2.0" />
</system.web>
answered on Stack Overflow Jan 13, 2020 by Alpesh Vaghela • edited Jan 13, 2020 by Alpesh Vaghela

User contributions licensed under CC BY-SA 3.0