MV3D Development Blog

January 23, 2008

Respect my authorization!

Filed under: Uncategorized — SirGolan @ 12:27 am

A little while back, I noticed that the way logging in was handled on MV3D servers was rather terrible in the security department. It wasn’t completely horrible given the network design it was built for. Originally, MV3D was going to be only run on servers I controlled, so trusting the servers with a lot of things was more or less ok. However, now, the plan is that anyone can run a server and connect it in to the MV3D network. That means I suddenly can’t trust servers any more.

The initial way it worked was that you’d connect to a random server, give it your username and password and then it would either validate it locally, or fetch your account data from an Account Server (including password) and then validate. Clearly, that doesn’t even come close to cutting it any more. My next idea (and the ticket that got me started thinking about this) was to connect to a random server, give it your username and password, and have it send that to an Account Server. You may see that there’s a slight problem there, too. If you can’t trust the server you’re giving your username and password to, then what?

Try 3 is to send your username and password to an Account Server and get back an authorization token. You can then pass those tokens to servers you want to log in to. Those servers contact the Account Server to check the token and either boot you or let you in depending on what it says. That’s a lot better, but there are still some holes in it. Say, someone is running a server and wants to break in to accounts. All they’d have to do is keep working auth tokens and use them to log in to the person’s account.

Now what? I was thinking I could add some information into the auth token such as IP address, but, uh, that’s pretty easy to fake, and the evil server is going to know that info. My most recent idea is to add a login server into the mix that would be a trusted server and would proxy back to an account server to check passwords. The login server would have to be a trusted server. In fact, clients (which in this case could be other servers) should speak to it in SSL and require the user to validate certificates of new servers or something. That would leave it in the user’s (or server admin’s) hands to know if they could trust a login server. Possibly more ideas on this later. Just a quick note about who uses the Login Server. When one server talks to another, it needs to authenticate, and therefore should use the Login Server. Clients of course also need to use it. For simplicity, I’ll just refer to users of the Login Server as clients.

A client would contact a Login Server before contacting anything else and send over its username and a message containing some info about the server it wants to log in to encrypted with its password. The Login Server hands back an authentication token that basically consists of the username, the server info the client sent in, a timestamp, and some random data encrypted with a temporary encryption key that only the Login Server knows. The client can then disconnect from the Login Server.

The client then connects to the desired server and sends that authentication token to it (no username). The server connects to a Login Server and passes on the authentication token and the server’s info. The Login Server decrypts the token and verifies the data including making sure the date is recent enough. If everything matches up, the Login Server passes back the least amount of user info required for the server to do its thing. The temporary encryption key is then forgotten. The user is allowed access to the server.

Sounds pretty convoluted. Maybe I should just use kerberos or something. But either way, can anyone poke holes in my method? It is fairly similar to kerberos in some ways.

2 Comments »

  1. Cellulite Reduction…

    MV3D Development Blog » Respect my authorization!…

    Trackback by Cellulite Reduction — May 12, 2013 @ 4:27 pm

  2. HTTP://www.secretenhancers.com/…

    MV3D Development Blog » Respect my authorization!…

    Trackback by HTTP://www.secretenhancers.com/ — May 20, 2013 @ 4:20 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress