RE: Authentication Ticket Persistance

From: D Voss (dvoss_at_mainstreet.fiserv.net)
Date: 04/29/03


Date: Tue, 29 Apr 2003 09:33:24 -0700


Sorry for the delay in responding to your questions about this issue. I
thank you for your reply, and would like to provide you with some more
information.

You response to my original issue points out that the application on
abc.net should not be able to read the authentication cookie written by
xyz.net. I have some additional information that I thought you might
find interesting. I believe this could possibly be a security issue
with asp.net.

The inability to read cookies across domains was anticipated. Although,
I didn’t explain how I was handling this in my original post. My login
code running on login.xyz.net actually writes the authentication cookie,
then checks the domain of the ReturnURL from the calling application
(app1.abc.net). The ReturnURL domain (abc.net) is different from the
authentication URL domain (xyz.net). In the case of a different domain,
my login application would not simply redirect to the calling
application, but would do a form post back to the Return URL containing
a single hidden field named with the Authentication Cookie Name
containing the Authentication Ticket Cookie value in it. The calling
application on app1.abc.net would then check for an authentication
cookie as follows:

Try
          strCookieValue = Request.Cookies _
              (FormsAuthentication.FormsCookieName()).Value
Catch
          ‘On error there was no authentication cookie, so
          'look for a form postback
          strCookieValue = Request _
              (FormsAuthentication.FormsCookieName())
End Try

When I traced through this code, the line of code within the Try was
always successful. Therefore, I assumed that the cookie written by the
login application was readable by the calling application. NOTE: This
was also the line of code that changed the state of the Authentication
Cookie to be persistent.

Upon receiving your response, I decided to research the issue further.
It turns out that although the line of code within the try statement was
specifically referencing Request.Cookies(…), it was actually reading the
form field posted back from the login application. Therefore, it
appears that a form field posted to an ASP.Net application with the same
name as an expected cookie could trick the application into reading the
cookie and in turn persisting that cookie.

I hope this information is valuable to you.

Dale Voss
Lead Web Developer
Fiserv, Inc.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Relevant Pages

  • RE: Forms authentication cookie handling question (C#)
    ... I also replaced all of my ticket authentication code with the ... // Username and or password not found in our database... ... LoginControl's default code logic to generate authentication cookie. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Forms Authentication
    ... The DNS entry for my domain was not set corrretly, ... This should have overcome the cookie ... authentication ticketis not correctly set to the domain your ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Forms authentication cookie handling question (C#)
    ... programmatically generate forms authentication ticket and set it in ASP.NET ... You use the Login control's "Authentication" event to do the user ... LoginControl's default code logic to generate authentication cookie. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: authentication cookie vs session cookie
    ... level of using authentication cookies on the client machines. ... authentication cookie on a manager's machine is stolen and used on a client ... > session variables as it relies on the session cookie that ASP.NET sends to ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • RE: forms authentication cookie problem
    ... authentication cookie. ... what's going on on the server. ... >324488 Forms Authentication and View State Fail ... >characters, the browser will still request the page, but ...
    (microsoft.public.dotnet.framework.aspnet.security)

Loading