XSS to change ASP.NET session state

Posted by Juri Bogdanov on Stack Overflow See other posts from Stack Overflow or by Juri Bogdanov
Published on 2010-06-16T17:13:06Z Indexed on 2010/06/16 17:32 UTC
Read the original article Hit count: 319

Filed under:
|
|

Hello! I am developing the application that stores current user and user's role to session state (System.Web.SessionState.HttpSessionState Page.Session).

        if (Session["username"] == null)
            Session.Add("username", User.Identity.Name);

        if (Session["isAdministrator"] == null)
            Session.Add("isAdministrator", User.IsInRole(domain + "\\Domain Admins"));

After I check these session states in code behind for granting permissions to some excecution:

    if ((bool)Session["isAdministrator"] || computer.Administrators.Contains(Session["username"].ToString()))

My question is next: how safe that mechanism is? Is it possible to change the session states using some JavaScript for example or some how else?

Thanks :)

© Stack Overflow or respective owner

Related posts about c#

Related posts about JavaScript