Yahoo gets hit with a massive data breach. Adult Friend Finder, LinkedIn, the list goes on and on and on.
Server breaches are inevitable.
Or at least you should assume that they will happen.
One danger is the loss of user passwords.
The combination of user names and passwords can allow a breach at one site to spread across the Internet.
While it is a good idea for your users to use different passwords and protect themselves, online services (you know, the guys who are getting compromised) can do more to protect user information. Like not using emails for userIDs or having public userIDs at all.
We can also do a better job of protecting passwords at an online site.
An outdated design
The standard way to protect passwords on a server is to use an irreversible transform (or hash function) combined with a userID specific seed to process the password and store the transform on the server.
UserPasswordRecord = UserID, userSeed, Hash(userpassword,userseed)
Common mistakes here (and they still occur 5 decades later) include:
- Using an encryption function instead of an irreversible transform (which allows the password to be literally decrypted and recovered).
- Not using a user unique seed which allows all of the passwords on a server to be attacked at once: Dictionary attacks against user passwords can be run: Hash(userpassword) for everybody since a single guess will work on all user accounts.
- Public userIDs make attacks scalable - the trivial association of a UserID with a person makes it easier to take information from one data breach and bootstrap it into another.
The problem is that the whole basic password protection design was created back in the days of very expensive (and pretty darn secure) mainframes.
We aren't in that Kansas anymore.
Hardware is cheap.
Very cheap.
Networking is easy.
How about a basic password appliance?
The 2-factor authentication fallacy
It is worth noting that when online sites today push you to use 2-factor authentication, they may be making it harder to break into your account using your password, but it does nothing on its own to protect against an actual server breach or to protect your account or account information if the server is breached.
Enter the Password Oracle
A password oracle is a dedicated server (or appliance or virtual server)... separately administered (perhaps a third party service, perhaps operated remotely) that simply answers the question:
Is this userID/password pair legitimate?
Now, simply moving your password process onto a separate machine would be a big improvement here.
One of the ways breaches actually wind up occuring is that "everything" is hosted on a shared server with a shared database (because it is easy) and when one of the (many) applications gets updated, it has a vulnerability that is exploited and bootstrapped to allow an attack on user account information (including the password system).
Simply separating the login system (and database) to a separate server / database at least minimizes the cross-contamination problem (please have different system administrator accounts or, even better, individuals, for the login system).
But, let's take this one better.
The login server can be separated from the password server (password Oracle).
On the login server, the user authentication record gets changed to:
User Authentication Record = userID, passwordOracleUserID,userOracleKey
When a user attempts to login, the login server would take the received password, use the userOracleKey to expand the password and pass the following to the Password Oracle:
Oracle Query = passwordOracleUserID, Expanded(userPassword,userOracleKey)
The Password Oracle would then use the passwordOracleUserID and expanded user password to verify the password and return a result.
Now, if the login server is compromised, the only thing that is compromised is a list of user IDs - not too exciting.
If the password Oracle is compromised, the user record is:
password Oracle Authentication Record = passwordOracleUserID, passwordOracleUserIDseed, Hash(Expanded(userPassword,userOracleKey),passwordOracleUserIDseed)
... a long winded way of saying that there isn't enough information to easily run a dictionary attack as the expanded user password key is not known by the password Oracle making "going backwards" a big pain.
Thus, if you set the system up right, 2 independent hacks of 2 independent systems would be required to get at a user account.
Not perfect. But better.
Combined with other measures, we can make online sites much more resilient in the face of data breaches.
Are you interested in more details of how this works, just ask me.
Are you interested in more details of how this works, just ask me.