Summary #

Netsparker detected that ASP.NET ViewStateUserKey is not set inside of the ASP.NET application

Impact #

When the ASP.NET ViewStateUserKey is not set, that makes it easier for an attacker to perform CSRF attacks. ViewStateUserKey prevents the attack by allowing you to assign an identifier to the view-state variable for individual users so that attackers cannot use the variable to generate an attack.

Actions To Take #

Please add the code below to all of your pages.

 

using System;

using System.Web.UI;

class ExampleClass : Page

{

    protected override void OnInit (EventArgs e)

    {

        // Assuming that your page makes use of ASP.NET session state and the SessionID is stable.

        ViewStateUserKey = Session.SessionID;

    }

}
Classifications #
CWE-16; OWASP 2013-A5; OWASP 2017-A6
Vulnerability Index

Vulnerability Index

You can search and find all vulnerabilities

OR

Search Vulnerability

Netsparker

Dead accurate, fast & easy-to-use Web Application Security Scanner

Get a demo