46 points · by captn3m0 · 7y ago · 23 comments
This is a common mistake.
Don't ever do opportunistic upgrades. Instead, upgrade all at once and retain "legacy" metadata needed to re-authenticate the user until their password hash is rotated. https://paragonie.com/blog/2016/02/how-safely-store-password...
Beyond that: Bcrypt is great, SHA1 is terrible, and the level of technical detail in this advisory is excellent. The fact that I was even able to critique their 7 years old security decision at all speaks volumes to the transparancy.
Don't make this mistake. Rehash all of them up front.
The details of whether or not users are forced to change their password is irrelevant to the escape route from this trap.
They'd still have leaked all of the insecure hashes of people who never logged in after the change in 2012 -- and that's still not good enough.
Immediate remediation means never keeping toxic hashes on hand, and never having to say to any subset of your customers "Sorry, but your password has been compromised due to our incompetence".
If you ever come across insecurely hashed passwords in your career, always remediate all of them with a second more secure hashing strategy at once.
Nothing against Flipboard, and I appreciate the level of transparency here, but it's annoying to think that I created that account 7 or 8 years ago, haven't touched it since, and it's still there, with the potential to be a liability to me.
If users created or changed their password after March 14, 2012, it is hashed with a function called bcrypt. If users have not changed their password since then, it is uniquely salted and hashed with SHA-1.
They could have migrated all accounts regardless of whether they came back to the site or not, changed their password or not, etc. Just use:
password_hash = bcrypt(sha1(raw_password))
What you're looking for is a pepper [0]
horrible psuedocode follows...
cryptchoice = len(username) % 3
switch cryptchoice:
case 0:
pepper = pepper[1]
salt = email
case 1:
pepper = pepper[0]
salt = creation_time
case 2:
pepper = pepper[2]
salt = username
bcrypt(salt+password+pepper)