Quantcast
Channel: Security Vulnerability
Viewing all articles
Browse latest Browse all 317

CSRF question

$
0
0

I am investigating a CSRF finding in asp.net c# code behind  as shown in the following code:

LinkButton LinkButtonControl = new LinkButton();
LinkButtonControl.ID = Name;

Now, I feel that the following code using ViewStateUserKey is the right approach:

protected override OnInit(EventArgs e) {
     base.OnInit(e); 
     if (User.Identity.IsAuthenticated)
        ViewStateUserKey = Session.SessionID; }

However; another person I work with thinks that the Httputility.htmlencode method is the correct way to solve the problem. First I don't know if the Httputility.htmlencode method is the best way and if so I would I use it?


Viewing all articles
Browse latest Browse all 317

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>