Download Netsparker

ViewStateMac Option is Not Enabled (ASP.NET ViewState anti Tampering Protection)

Netsparker detected that MAC validation is disabled in ViewState data.


An attacker can tamper with the application's state variables located in the ViewState data structure.


ASP.NET uses a hash code-based integrity solution called "ViewStateMac" to protect ViewState parameters against tampering attacks. You can implement this solution on a page or application level.

Actions to Take

  1. For page-based protection, place the following directive at the top of affected page.
    <%@Page EnableViewStateMAC=true %>
  2. You can also set this option for the whole application by using web.config files. Apply the following configuration for your application's web.config file.
        <pages enableViewStateMac="true">

Remedy References

Go back to the Complete list of Vulnerability Checks.