@manhng

Welcome to my blog!

A potentially dangerous Request.Form

June 11, 2020 15:17

A potentially dangerous Request.Form value was detected from the client (edit)

  • XSS (Cross-site scripting)
  • [AllowHtml]
  • [ValidateInput(false)]
  • requestValidationMode & validateRequest

Problem:

https://docs.microsoft.com/en-us/aspnet/whitepapers/request-validation

Solution: 

https://www.ryadel.com/en/potentially-dangerous-request-form-value-detected-client-fix/

https://www.aspsnippets.com/Articles/ASPNet-Error-A-potentially-dangerous-RequestForm-value-was-detected-from-the-client.aspx

https://www.c-sharpcorner.com/article/a-potentially-dangerous-request-form-value-was-detected-from-the-client/

https://qawithexperts.com/questions/303/a-potentially-dangerous-requestform-value-was-detected-from

https://stackoverflow.com/questions/1455528/a-potentially-dangerous-request-form-value-was-detected-from-the-client-asp-ne

https://stackoverflow.com/questions/17254354/asp-net-mvc-a-potentially-dangerous-request-form-value-was-detected-from-the-cli

Controller:

  • [AllowHtml]
  • [ValidateInput(false)]

Web.config:

<configuration>

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

<httpRuntime requestValidationMode="2.0"/>

<configuration>
    <system.web>
        <pages validateRequest="false" />
    </system.web>
</configuration>
 

Categories

Recent posts