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?

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,254 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,245 questions
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,066 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