Is there a risk of using @ Html.Raw?

Is there a risk of use @Html.Raw? It seems to me that it should not be. If there is a risk, then this risk will not exist regardless of the @Html.Rawfact that modern browsers, such as Chrome, will allow you to edit the injection <script>malicious()</script>or even change the action of submitting the form to something else.

+5
source share
3 answers

@Html.Rawwill allow to execute any script that is on the displayed value. If you want to prohibit use@Html.AttributeEncode

+5
source

Right, the risk is how it is used. There is Html.Rawno risk. This is a tool, nothing more.

+4
source

, @Html.Encode().

, displaying non-user eneterd data, @Html.Raw()

+2

All Articles