A potentially dangerous Request.Path value was detected from the client (<) asp.net 4.8

Asap74 61 Reputation points
2021-12-13T17:58:48.227+00:00

[HttpException (0x80004005): Valore potenzialmente pericoloso Request.Path rilevato dal client (<).]
System.Web.HttpRequest.ValidateInputIfRequiredByConfig() +11790525
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +75
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +158

i've in my web.config:
<pages enableSessionState="true" validateRequest="false"

and in my page directive:
ValidateRequest="false"

any ideas?

Developer technologies | ASP.NET | Other
Developer technologies | C#
0 comments No comments
{count} votes

Accepted answer
  1. Jose Zero 576 Reputation points
    2021-12-13T20:28:22.577+00:00

1 additional answer

Sort by: Most helpful
  1. Yijing Sun-MSFT 7,096 Reputation points
    2021-12-14T03:29:09.38+00:00

    Hi @Asap74 ,
    As far as I think,you are not only add ValidateRequest="false" and requestValidationMode="2.0", but also you need to convert the string to its HTML encoding equivalent(so "<" is converted to "<", etc).Please use HttpUtility.HtmlEncode. You could refer this article.

    Best regards,
    Yijing Sun


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.