News for hackers. Stuff that matters.
Re:Dropbox prompts password resets by pixelcort on Friday August 26, 2016 @12:13AM (#12364198)
This line of reasoning always confused me. To upgrade to a stronger scheme, couldn't a service just rehash the prior hashes subsequently with a stronger scheme?

So for those users you'd have newScheme(oldScheme(password)). Then you could do a one-time migration of users with older scheme to increase the security to the new one.

Re:Dropbox prompts password resets by Svenskunganka on Friday August 26, 2016 @12:40AM (#12364264)
That's a waste of resources, because each subsequent time a user logs in you have to hash the password twice with two different hashing schemes to verify their password.

The normal way of doing this is when the next time the user logs in, you use the old hashing scheme to check that the passwords match, if they do, you hash the password with the new hashing scheme and overwrite the old one with the new one. This is often coupled with invalidating all session tokens to force all users to login again (in order to speed up the process of migrating active users to the new hashing scheme).

The problem comes with the users that hasn't logged in for years, they still have their password hashed with the old scheme, but normally you would invalidate those hashes. That means getting rid of them completely so if a data breach would occur, their accounts doesn't have any hashes that could be attacked (UPDATE users SET password=null WHERE hashing_scheme='old'). From the users perspective, this would force them to reset (it's actually set now, not reset) their password via their email.

Re:Dropbox prompts password resets by medmunds on Friday August 26, 2016 @12:52AM (#12364301)
> each subsequent time a user logs in you have to hash the password twice with two different hashing schemes

The first time such a user logs in, you can upgrade their hash to the latest scheme, so there's no extra work on later logins. Django, e.g., does just this, automatically.

https://docs.djangoproject.com/en/1.10/topics/auth/passwords...

Re:Dropbox prompts password resets by Svenskunganka on Friday August 26, 2016 @12:54AM (#12364304)
That's exactly what I was implying...
Re:Dropbox prompts password resets by medmunds on Friday August 26, 2016 @01:30AM (#12364401)
Sorry, I was trying to point out that you can have it both ways. As pixelcort suggested, do a one-time upgrade of all (weak) hashes to newScheme(oldScheme(password). But then as users login, you can upgrade them to just newScheme(password). No need to force a reset just because people haven't logged in recently.

I'm familiar with Django, and they happen to have some nice docs on both parts of the process: bulk upgrade to stronger scheme by wrapping [1] and individual upgrade on login [2]. But the technique isn't unique to Django.

[1]: https://docs.djangoproject.com/en/1.10/topics/auth/passwords... [2]: https://docs.djangoproject.com/en/1.10/topics/auth/passwords...

Re:Dropbox prompts password resets by Svenskunganka on Friday August 26, 2016 @01:47AM (#12364464)
Alright, I understand now. A bit hard to figure that out from your original comment though, but thank you for clarifying!

I'm curious about using two different algorithms for hashing at the same time would affect entropy. It could be that the original plain-text password has better entropy than the SHA1 hash (if that was your old hashing scheme) of the original password has.

Re:Dropbox prompts password resets by StavrosK on Friday August 26, 2016 @05:15AM (#12365120)
It might, but nobody is going to discover your password by brute-forcing the SHA1 digest result.
Re:Dropbox prompts password resets by bigiain on Friday August 26, 2016 @01:37AM (#12364428)
> (UPDATE users SET password=null WHERE hashing_scheme='old')

Except you did this while the world was on fire, late on a Friday night, after a few beers, with management screaming down the phone. And you didn't check to make sure it didn't allow anyone to log into all effected users accounts with a null/empty password. Oooops...

(Been there, done that, made similarly stupid mistakes...)

Re:Dropbox prompts password resets by marcosdumay on Friday August 26, 2016 @11:39AM (#12366975)
An empty string hash does not equal the empty string (if you are on Oracle) and does certainly not equal null.

This will make it impossible for those users to login. Also, if you are luck it won't take the rest of the service down with them, making it impossible for the other users to login too.

Re:Dropbox prompts password resets by jonlucc on Friday August 26, 2016 @08:45AM (#12365778)
Biologist here; so would the proper approach be

UPDATE users SET password=[generateRandomString] WHERE hashing_scheme='old';

?

Re:Dropbox prompts password resets by anujanpan on Friday August 26, 2016 @10:04AM (#12366317)
No, same query but you need to make sure your authentication system disallows logging into accounts with null / empty passwords.
Re:Dropbox prompts password resets by Grangar on Friday August 26, 2016 @04:19AM (#12364944)
Wow, ouch.
Re:Dropbox prompts password resets by Dylan16807 on Friday August 26, 2016 @05:11AM (#12365105)
Waste of resources? If you're upgrading hashes, the new one should be nice and slow anyway. It doesn't matter if you end up doing an extra 1% work.
Re:Dropbox prompts password resets by patio11 on Friday August 26, 2016 @01:37AM (#12364430)
This works, but if you've previously leaked a copy of the old hashes, then old passwords which are still in use are still only as secure as the old hashing mechanism. They won't be running old hashes against Dropbox's live service, they'll be dropping guessed passwords against Dropbox's live service. It doesn't matter if that password is now secured by bcrypt-with-a-hefty-cost-factor wrapped around MD5, improving its security versus being done in just MD5 -- if the password is right then the attacker will get through.
Re:Dropbox prompts password resets by tomjen3 on Friday August 26, 2016 @03:42AM (#12364837)
As a Dropbox user I am just going to change it back to my old password anyway.
Re:Dropbox prompts password resets by StavrosK on Friday August 26, 2016 @05:15AM (#12365122)
Why? Use a password manager, then new passwords become free.
Re:Dropbox prompts password resets by mrswag on Friday August 26, 2016 @05:38AM (#12365186)
I know I should, but I can't bring myself to it.

I'm constantly switching between three OS, two browsers, different, sometimes auto-resetting computers, and it seems to be too much of a hassle.

How do I handle this? The only obvious option is a paper notebook.

Re:Dropbox prompts password resets by bbrks on Friday August 26, 2016 @06:21AM (#12365306)
LastPass works fine for me in this scenario (plus a mobile device).

I'd rather be on an Open Source password manager, but I've found the sync is always too painful to do yourself.

Re:Dropbox prompts password resets by icc97 on Friday August 26, 2016 @08:43AM (#12365764)
I'm only on two OSes (Windows, Linux) and predominantly two browsers (FF, Chrome), but Keepass (Works in Windows and Linux - pretty sure Mac too) + KeepassHttp plugin + PassIFox [1] + ChromeIPass [2] works for me.

I find it also nicer than LastPass as it combines with the native password saving of FF/Chrome rather than the highjacking and restyling of input boxes that look like user/passwords done by LastPass.

  [1]: https://github.com/pfn/passifox
  [2]: https://chrome.google.com/webstore/detail/chromeipass/ompiailgknfdndiefoaoiligalphfdae/related?hl=en-US
Re:Dropbox prompts password resets by nialo on Friday August 26, 2016 @11:11AM (#12366788)
KeepassHttp is not even a little bit secure if run over a network, see for example: https://github.com/pfn/keepasshttp/issues/258

It's probably fine so long as both your 'client' and 'server' are on localhost, but it'll probably never be secure if the server is exposed to the internet.

Re:Dropbox prompts password resets by rrdharan on Friday August 26, 2016 @11:43AM (#12366996)
I regularly switch between a MacBook for work, Linux desktop at work, Windows 10 home machine, iMac home machine, iPad, and iPhone, using at least two browsers on each (Chrome/Safari or Chrome/Edge) and often two Chrome profiles.

I use 1Password with the encrypted vault synced to Dropbox and it works wonderfully well. 1Password has native apps / browser extensions for all of those platforms (except Linux local app where they support and recommend using Wine).

Re:Dropbox prompts password resets by StavrosK on Friday August 26, 2016 @12:55PM (#12367543)
I use KeePass with Keepass2Android (which has Dropbox integration), and Firefox Sync. You can log in to Firefox Sync and all your passwords will be there with you, but the canonical storage is KeePass. If I'm at a resetting computer, I just type it by hand from the mobile phone. It's not quite as convenient as using one password for everything, but it's a little bit less convenience for orders of magnitude more security.
Re:Dropbox prompts password resets by kevinastone on Friday August 26, 2016 @11:59AM (#12367118)
This becomes tough when my passwords are synced via my dropbox account. I need to memorize my app store and dropbox passwords, the rest of "free".
Re:Dropbox prompts password resets by pyre on Friday August 26, 2016 @12:29PM (#12367339)
Not unless you make sure you backup your password file somewhere other than dropbox. It doesn't even have to be very often, just whenever you update your Dropbox password (for example).
Re:Dropbox prompts password resets by zaidf on Friday August 26, 2016 @04:34AM (#12364979)
A good PM would state in the specs to check the new password isn't the same as the old one.
Re:Dropbox prompts password resets by erelde on Friday August 26, 2016 @02:30AM (#12364596)
It's the same thing if the user re use their password though.
Re:Dropbox prompts password resets by azundo on Friday August 26, 2016 @12:44AM (#12364279)
Isn't the point that the old hashes are out there somewhere and if cracked would reveal the plaintext password? This would then allow the attacker to access the compromised account since the password itself has not changed even if hashes are updated by doing newScheme(oldHash).
Re:Dropbox prompts password resets by medmunds on Friday August 26, 2016 @01:37AM (#12364425)
If your db has already been breached, it's too late to upgrade security on those hashes, true.

But if you're trying to proactively strengthen your password hashes to make them more resistant in case of a future breach, this lets you do that with no inconvenience to your users.

[dead]
Re:Dropbox prompts password resets by medmunds on Friday August 26, 2016 @04:02AM (#12364899)
I'm certain you're right, and I'm here to learn.

Genuinely curious about the risks to upgrading password algorithms by wrapping the old hashes. (Because at least one major framework seems to suggest this approach.) Is this an absolute cryptographic disaster, or a tradeoff to weigh against other concerns, or ...?

The alternatives seem to be never upgrading your hash algorithms/iterations (which leaves old, weak hashes in your db -- clearly problematic in the event of a breach), or forcing userbase-wide password resets every time you upgrade (which could be a major inconvenience for the users, making it a reason to avoid or delay strengthening your password hashing -- also problematic).

[Just to be clear: I'm leaving all of this to my framework--I do know enough not to try to roll my own security. But I'd like to try to understand the decisions the framework maintainers make, and their potential ramifications.]

Re:Dropbox prompts password resets by bigiain on Friday August 26, 2016 @01:43AM (#12364448)
That's better for the _next_ time your site is breached and you newScheme hashes get exposed.

Doesn't help if $attacker has a list of breached oldScheme(password) hashes, and can crack useful numbers of passwords from you old weak oldScheme hash. They can still log into migrated accounts if they can reverse oldScheme into the characters of password.

If you're preemptively upgrading your password hashing aglo with the assumption that you have not (yet) been breached, that works (if your assumption is good). Once the oldScheme hashes are out there though, it's too late.

Re:Dropbox prompts password resets by Swizec on Friday August 26, 2016 @12:34AM (#12364250)
I'm rusty on theory, but if I remember correctly, double hashing can reduce entropy and thus leak information and make passwords easier to crack.
Re:Dropbox prompts password resets by hiou on Friday August 26, 2016 @01:08AM (#12364338)
This one gets it. Most hashes are fixed length
Re:Dropbox prompts password resets by Dylan16807 on Friday August 26, 2016 @05:10AM (#12365095)
That's not a realistic worry.
Re:Dropbox prompts password resets by tedunangst on Friday August 26, 2016 @01:43AM (#12364453)
One would hope your hashing scheme involves a salt and maybe even a work factor, and when you start including all the parameters, it's not so simple as A(B(C(P))).
Re:Dropbox prompts password resets by i386 on Friday August 26, 2016 @12:16AM (#12364204)
Because $password isn't the original value. It should be a hash written when the password is set and the original is thrown away.
Re:Dropbox prompts password resets by bdcravens on Friday August 26, 2016 @12:24AM (#12364224)
You don't need original password, hash the hash.

    if date < '2016-01-01'
        return newly_hashed == new_hash(old_hash($password))
Re:Dropbox prompts password resets by sirius87 on Friday August 26, 2016 @12:46AM (#12364283)
And hash twice again during login/password lookup then? Can be done, but tedious.
Re:Dropbox prompts password resets by mrswag on Friday August 26, 2016 @05:48AM (#12365217)
Yes, but it happens only the first time, if you update the stored hash with newHash(plaintext_password)
Re:Dropbox prompts password resets by bdcravens on Friday August 26, 2016 @02:43AM (#12364642)
Sure, not ideal, but would prevent mass password updates.
Re:Dropbox prompts password resets by efoto on Friday August 26, 2016 @12:29AM (#12364237)
@pixelcort is correct here, it is possible to do it that way:

If a DB has an old hash, call it V1 obtained as H1(password), one can apply a newer hashing scheme H2(V1) and save V2. To avoid having two classes of users forever one can always apply H2(H1(password)) for new users.

It appears though, that this is not what dropbox did, when they changed the scheme to H2 in 2012, applying H2(password) for new users instead.