When Yahoo admitted that the 2013 breach of their site exposed the personal information of all 3 billion users of its email service, many people in the cybersecurity community were probably not surprised. Yahoo has been periodically updating the extent of the breach ever since it occurred, and, if it weren’t for Verizon, which recently took over the company, we may have never known the full extent of the breach. Verizon deserves some credit for trying to start over with a clean slate, though it may take them a while to shake off the Yahoo legacy.
Many users, however, probably took solace in the information that their passwords were not stolen. There was probably a huge sigh of relief followed by the usual ‘it’s-only-some- personal-information-so-what’ defense. I have written elsewhere about the short-sightedness of such a defense. A criminal possessing your personal information could subject you to, at the very least, spamming attacks which, of themselves, could be used to compromise your device and network. At the highest level, you could lose your identity and the contents of your bank account.
Besides, it is not precisely true that passwords were not stolen in this breach. That’s actually a semantic construct. Passwords, in their pure, readable form, are stored on very few sites. Most passwords are ‘hashed’ before they are stored. An algorithm is applied to your password to transform it into a unique string of characters. It is this hashed string that is stored, not your password. When you sign into your account, the password you signed in with is again hashed and compared with the stored hashed password. If the two match with your username, you are allowed to proceed. A person who has only your hashed password cannot perform a reverse operation on it to get the original unhashed password. Sounds pretty good, right?
Yahoo claims that it stored passwords using the MD5 algorithm. Is this good or bad? It is better than the worst hashing algorithm but far from the best. When hackers get a hashed password, they can simply guess at the password it was based on. That’s why simple or often used passwords are easily guessed. Here is an example.
The MD5 hash of the password, ‘password’, is:
How do I know? Easy. I just go to this website, type in the password I want hashed, and get the hash created by the MD5 algorithm. Thus, I can use this information to search a list of hashed passwords to see how many accounts are using the password, ‘password’. You can imagine that hackers have already created lists of the most common passwords based on pre-computed hashes. These are referred to as “rainbow tables”.
So, if I take the hashed password I created above, I should be able to find it in a rainbow table. To test this out, I went to this site and typed in the hash. It returned this result,
Apparently, the hash was correctly decoded.
Yahoo admitted that it was using MD5 hashing when it was hacked in 2013 but claimed that it soon after changed to bcrypt hashing, which is much more secure. However, if users have not changed their passwords since the original hack, it is possible that hackers already have access to their accounts. More disconcerting is the fact that experts think that between 800 and 900 million passwords could have been decoded within weeks of the breach and before bcrypt was implemented. In short, if you haven’t changed your password since the initial breach, you are still in danger. And remember, if you use the same password, or simple variations on it, on other accounts, those accounts, too, are in danger.
It is also important to note that, although bcrypt is much more secure, it is not foolproof. It adds a random string of code (salt) for each user’s password, which makes a rainbow table impossible to construct as each user has a different code even if the password they use is the same. Bcrypt’s secret is to use time against a hacker. They put in an encryption loop which would slow down a hacker trying to decrypt a large number of hashed passwords.
A bcrypt generator for the password, ‘password’ will give this much more complex result.
I can see if the hash matches the password by going to this site. If I compare a known or guessed password to a bcrypt hash, I get this result.
Sadly, this would only give me the password for one user, not for every user who uses the same password. However, if a hacker hacked a site and only found a database of bcrypt hashes, they could use this information to see if a password that they already know for a user (username) on one account is being used on another account. (Keep in mind that credit card information is also hashed on most sites, but that’s a different discussion.)
The other disconcerting news concerning the Yahoo hack is their admitting that “in some cases, encrypted or unencrypted security questions and answers” were compromised. It is easy to see that anyone obtaining the answers to your security questions could reset your password and take control of your account. Even if they didn’t have the answers directly, they may be able to use the personal information they stole to compromise your account.
So, should you be breathing that sigh of relief that your Yahoo password was not stolen? I would suggest you go to the Have I Been Pwned? website and type in your Yahoo email address. If your name shows up as having been pawned and you haven’t changed your password since 2014, change it. Make it 16 characters long (as in a phrase that’s easy for you to remember) and you don’t need to worry much. In fact, even if your account doesn’t appear as having been hacked and you use a shorter password, change your password for your own peace of mind.