News for hackers. Stuff that matters.
Re:Bitwarden Design Flaw by ywain on Monday January 23, 2023 @10:06PM (#34498625)
Oof, my Bitwarden account was created a while ago and was set to only 5,000 iterations. You can see and change the number of iterations here: https://vault.bitwarden.com/#/settings/security/security-key....

I've updated it to 600,000 iterations and so far don't see any noticeable impact on performance, both on desktop (using the Firefox extension) and on mobile (iOS).

Re:Bitwarden Design Flaw by mkasberg on Monday January 23, 2023 @10:29PM (#34498792)
I had bumped mine up once before (to 200K) and I just bumped it up again to 600K. But my wife (registered several years ago, like me) was still at 5K, I just bumped hers up too. Wish Bitwarden would force this for anyone still on an old default - particularly given the LastPass compromise we just saw.
Re:Bitwarden Design Flaw by philliphaydon on Monday January 23, 2023 @10:38PM (#34498856)
Thank you! Mine was also set to 5000, updated to 600k.
Re:Bitwarden Design Flaw by rstuart4133 on Tuesday January 24, 2023 @04:30AM (#34501522)
A way to think about the difference you just made is, you increased the difficulty of cracking your password by 600000 / 5000 = 120. Making your attacker guess 7 extra bits (well, slightly under) would have the same effect, so that translates to a slightly under 7 bits of entropy. Appending two randomly chosen digits to your password would have about the same effect.

Those first 5000 iterations added over 12 bits of entropy.

The article is complaining about not adding an extra 100,000 iterations which would double the difficulty, so he's effectively berating them over 1 bit of entropy.

Re:Bitwarden Design Flaw by ajorgensen on Monday January 23, 2023 @10:20PM (#34498710)
oof me too thanks for the nudge to check!
Re:Bitwarden Design Flaw by zeven7 on Monday January 23, 2023 @10:46PM (#34498926)
As of now, your link is fine (though the comment is probably still editable), and I believe you have the best of intetions but Note: It's not a great idea to click a link to something like Bitwarden, since a phishing domain could be used.
Re:Bitwarden Design Flaw by ywain on Monday January 23, 2023 @10:57PM (#34499023)
Fair enough, I added navigation instructions.
Re:Bitwarden Design Flaw by sircastor on Monday January 23, 2023 @10:48PM (#34498938)
I upped mine to more than 1M and haven’t seen any degradation of performance.
Re:Bitwarden Design Flaw by vena on Monday January 23, 2023 @11:25PM (#34499247)
did you fully log out/in or just lock/unlock?

iirc locking with BW doesn’t do what one might expect wrt encryption state.

Re:Bitwarden Design Flaw by ywain on Monday January 23, 2023 @11:26PM (#34499256)
Changing the number of iterations should automatically log you out on all devices. At least it did for me.
Re:Bitwarden Design Flaw by vena on Monday January 23, 2023 @11:38PM (#34499347)
oh good, didn’t know if it would do that/force a cache invalidation for clients
Re:Bitwarden Design Flaw by sircastor on Monday January 23, 2023 @11:36PM (#34499333)
It forced me out of all my logged in instances. I had to login to everything. With my master password and my 2nd factor.
Re:Bitwarden Design Flaw by orra on Tuesday January 24, 2023 @09:33AM (#34504024)
That's important to realise, in case your (normal) second factor is a different Bitwarden device!
Re:Bitwarden Design Flaw by sircastor on Tuesday January 24, 2023 @12:49PM (#34507179)
I didn't even think about this. My 2nd factor is through a different app, but if I'd been using BitWarden's TOTP I wonder if I would've been stuck.

A good reminder to also have printed (or something) OTPs accessible in a safe place in case you need them.

Re:Bitwarden Design Flaw by runnerup on Tuesday January 24, 2023 @12:22AM (#34499700)
The max allowed value appears to be 2 million iterations, and that still seems very very snappy on my original M1 MacBook Air.
Re:Bitwarden Design Flaw by realitysballs on Monday January 23, 2023 @11:02PM (#34499054)
Can someone Eli5 iterations in this context?
Re:Bitwarden Design Flaw by ywain on Monday January 23, 2023 @11:05PM (#34499074)
Iterations refer to the number of times the password goes through the hash function. The higher the number, the longer it takes, so you want it low enough that it doesn't impact your day-to-day use but high enough that it will hinder an attacker in case the hashed password is leaked.
Re:Bitwarden Design Flaw by eyelidlessness on Monday January 23, 2023 @11:59PM (#34499499)
Maybe overly pedantic to expand on this, but since we’re in an ELI5 context: the attack vector is brute forcing hash collisions. Making it computationally slow for attackers is a hindrance because the relative value of a collision diminishes over time (depending on the value of their target).
Re:Bitwarden Design Flaw by rcxdude on Tuesday January 24, 2023 @08:38AM (#34503375)
It's not really hash collisions: SHA256 is still too secure for that, you're unlikely to find a value which isn't the password used to generate it. It's just brute forcing the password
Re:Bitwarden Design Flaw by sircastor on Monday January 23, 2023 @11:47PM (#34499415)
Your master password is put in a box that’s very hard to break into. But because someone might be really determined to get in, we put that box in another box that’s just as hard to break into. And because someone might be really really determined, we keep putting those boxes in new boxes so it’s really really difficult to get to the password. But sometimes we also need to get to the password, so we use enough boxes that it’s difficult for them, but not so many that it’s annoying for us.

That might be a little too much “like I’m 5”, but that’s the general idea. Hashing is easy one way but it still requires compute cycles to do each iteration. We don’t want to make it excessively expensive for us.

Re:Bitwarden Design Flaw by nucleardog on Tuesday January 24, 2023 @12:22AM (#34499704)
To kinda just expand on that because I think the analogy's most of the way there:

You're trying to keep something safe and all you've got is a weirdly infinite collection of cardboard boxes. So you have this brilliant idea... you get a dozen boxes and put your treasure in one of them.

That's great, it's certainly safer than leaving it laying out. It'll take someone at least like... a minute to go check all dozen boxes and find your treasure. But it still only takes you mere seconds because you know which box to open.

Except you'd really rather your treasure stay safe for longer than a minute. So you take all your boxes and put them inside other boxes. And put those boxes inside other boxes like nesting dolls. You nest each one a dozen times.

So now if someone wants to come and find your treasure, they need to open all 144 boxes to find it! But you still only need to open 12 because you know which stack to look in.

The iteration count is basically just how deeply you plan to nest your boxes.

In more concrete terms, increasing the iteration count is just a knob to control how much cpu/memory resources it takes to compute a hash. You want to turn it up enough to make brute forcing prohibitively expensive (make it as high as you can), but not so much that calculating the single correct hash to verify is too expensive (don't make it too high or else it will take too long to check your password at sign-in). People are saying this should go up over time because computing resources generally become more readily available (faster/cheaper), making both brute forcing easier as well as allowing you to perform more iterations to compute the correct hash on commodity hardware without it taking unusably long.

Re:Bitwarden Design Flaw by kumarharsh on Tuesday January 24, 2023 @12:47AM (#34499873)
Thanks, this was a great explanation!
Re:Bitwarden Design Flaw by jdhendrickson on Tuesday January 24, 2023 @02:02AM (#34500382)
Feynman would be proud. The ability to take a complex subject and break it down in such a way that nothing of value is lost but a child can understand it is rare.
Re:Bitwarden Design Flaw by cl3misch on Tuesday January 24, 2023 @02:48AM (#34500706)
If there are 12^2 = 144 boxes total, you only need to open 2. Not 12 as you said.

Put differently: with x^y nested boxes, you only have to open y. The attacker has to open x^y.

Re:Bitwarden Design Flaw by Dylan16807 on Tuesday January 24, 2023 @03:35AM (#34501064)
No, you're thinking of something different, like making the password more complex.

While they made it confusing by using "12" for two different things, their analogy is completely correct.

Instead of each password/location having one box, it has a box within a box within a box[...]. You have to unwrap the entire stack to check if the treasure is there.

If you use an iteration count of 5000, then when you log in you unfortunately have to do 5000 hashes. But an attacker has to do 5000 hashes per password guess.

So a deep iteration count can't substitute for a good password, but it can make up for an extra few characters. And it's basically free to increase iterations until the wait becomes visible.

Re:Bitwarden Design Flaw by rcxdude on Tuesday January 24, 2023 @08:41AM (#34503398)
Another issue is the hash used: SHA-256 is a hash which can be calculated extremely quickly on dedicated hardware (which has been incentivised heavily by bitcoin mining). So the gap between the speed at which an attacker can run the hashes vs the intended user is larger than with other hashes, like argon2, which is specifically designed to be resistant to acceleration by dedicated hardware.
Re:Bitwarden Design Flaw by tuhriel on Tuesday January 24, 2023 @03:48PM (#34510120)
Is it actually 144? Wouldn't that be the worst case scenario for the attacker? If I understand the whole thing correctly, the attacker can be lucky and find the right stack of 12 in the first try.

So basically, I would set it at around half of the 144: 72 or did I get something wrong there?

Re:Bitwarden Design Flaw by mhio on Tuesday January 24, 2023 @01:15AM (#34500052)
That's good, I like the box in box imagery.

PBKDF2 directly might be some sort of multiverse locked box? Store a "safe key" in a box, in a box, in a box, in a box, in a box... in an iteration of boxes.

Every key in the universe is able open the first box, and every other box. But each key opens up a different multiverse of boxes. The problem for the attacker is they have to open every box, in a box, in a box... in succession to get to a "safe key" stored in that multiverse, which looks like a safe key and quacks like a safe key, but might not be the right safe key.

Maybe not quite right, as the "safe key" is really just another box in the end, but that doesn't make much sense... unlike a box of multiverse of boxes =)

Re:Bitwarden Design Flaw by e12e on Tuesday January 24, 2023 @11:12AM (#34505500)
If your (binary, derived 128 bit) encryption key is the key your treasure chest - then the "derivation" is a map from your password ("hunter2") to the where the key (011101...) is buried.

With plain derivation, the map takes you directly from the password to the key. With an extra iteration, the map just points to a place on the map where a trail starts.

If you want to guess the key, by guessing the password - now you have to first walk to were the password points on the map, then follow the path (the iterations) - then dig and see if the key is there. Then you can try the key in the chest (the encrypted data).

The iterations (length of path) adds a certain, predictable, amount of work in order to find the key. It does not make it harder to guess the password, just harder to get the key from the password - and so it makes it harder to check if you've guessed the right password (try the key in the lock) - because there's extra work to be done.

Now you could compare memory-hard paths and compute-hard paths by adding elevation and distance to the analogy (different types of hard work).

Re:Bitwarden Design Flaw by aidenn0 on Tuesday January 24, 2023 @12:15AM (#34499636)
I updated my master password in 2022, but my account was still set to 5000 iterations. Not increasing it on master key changes seems beyond careless.
Re:Bitwarden Design Flaw by devwastaken on Tuesday January 24, 2023 @01:35AM (#34500191)
I checked a two year old account and it's at 100k, might have been changed though.
Re:Bitwarden Design Flaw by bjoli on Tuesday January 24, 2023 @02:38AM (#34500616)
600.000 was a bit too much for my 3 year old low-end android phone. 400k workes OK. when I sorted everything into folders I could bump it up to 600k probably due to time saved rendering.
Re:Bitwarden Design Flaw by jve on Tuesday January 24, 2023 @02:51AM (#34500728)
Some warning to users: Changing iterations MAY corrupt your data:

> Making changes in a session with a “stale” encryption key will cause data corruption that will make your data unrecoverable.

https://community.bitwarden.com/t/increasing-kdf-interations...

https://news.ycombinator.com/item?id=34152181

EDIT: Look below, this actually applies to changing master password.

Re:Bitwarden Design Flaw by kadoban on Tuesday January 24, 2023 @03:03AM (#34500825)
> Some warning to users: Changing iterations MAY corrupt your data

This is incorrect.

https://bitwarden.com/help/what-encryption-is-used/#changing...

> When you change the iteration count, you'll be logged out of all clients. Though the risk involved in rotating your encryption key does not exist when changing KDF iteration count, we still recommend exporting your vault beforehand.

Re:Bitwarden Design Flaw by EspadaV9 on Tuesday January 24, 2023 @03:10AM (#34500869)
That is when you change your master password, or rotate your encryption keys, not changing the number of iterations (as far as I can tell).

From what I read, changing the number of iterations is safe to do.

Re:Bitwarden Design Flaw by adament on Tuesday January 24, 2023 @03:08AM (#34500853)
I am not a cryptographer but to my understanding, the number of PBKDF iterations is really only of concern for weak (low-entropy) passwords. If you know that your password has high entropy (>128 bit), for example because you generated it randomly uniformly from at least 2^128 possible outcomes[1], you are safe even if you used only 1 iteration. PBKDF is all about password strengthening, so if you are making changes for yourself the most effective change is just to use a secure password and stop worrying about key derivation functions.

[1] 28 characters in a single case, 23 characters if both upper and lower case are used, 22 characters if you include numbers, 12 words if you use a word list of 2000 words and sample uniformly

Re:Bitwarden Design Flaw by e12e on Tuesday January 24, 2023 @10:59AM (#34505254)
> If you know that your password has high entropy (>128 bit)

I don't think that is practical for most users - 12 words (or 10 taken from a 10k list) - or 22 random alphanumeric characters - is hard to remember - and long enough that they are difficult to type correctly. 70 bits might be a more sensible goal - but still long. (6/7 words, 12 characters from a set of 62).

This is the "trust anchor", so something the user needs to remember and type in - from what I've seen - remembering/representing and inputting 128 random bits is tricky.

And with modest stretching and a salt, probably overkill anyway.

Re:Bitwarden Design Flaw by adament on Wednesday January 25, 2023 @12:28PM (#34521259)
I think your point is valid and important, especially considering the average user. However in my experience it worked surprisingly well with a long word based master password. Since I only needed to remember 1 password that I then used daily it was not that difficult. And typing it was quick since it was all lowercase which most keyboards are optimized for. However the issue came when I started using my password vault on my phone and tablet. I was way too slow at typing on them. I now have a 22 character password which takes the same time for me to type on a keyboard, maybe a bit slower, but is faster on my phone though still annoyingly slow.

As for 70 bits password, it might be enough, but you need a lot of iterations (2^58) if you want to completely make up for the lost security margin. Which will also be unusably slow in practice.

Re:Bitwarden Design Flaw by j1elo on Tuesday January 24, 2023 @05:37AM (#34501958)
Why are you upping it up that much? I guess "too much is not a bad thing" in this case, and Bitwarden itself says: "We recommend a value of 100,000 or more.".

When I see that I read: "With our knowledge of security and encryption, which by the way is much greater than yours, we consider that 100,000 is a perfectly safe number and a good middle point so go ahead and use it".

Am I wrong to think like that? My Master password is a battery-horse-staple thing, but not with 12 words as some other commenter says; that's absurdly long and would be too difficult for me to remember. I usually strive for around 18-20 characters, that's already in the verge of me forgetting it. I use incorrect or derived words of my own (so not really existing in dictionaries).

Re:Bitwarden Design Flaw by pricechild on Tuesday January 24, 2023 @05:47AM (#34502015)
OWASP seem to recommend that number. e.g. https://cheatsheetseries.owasp.org/cheatsheets/Password_Stor...
Re:Bitwarden Design Flaw by ThreePinkApples on Tuesday January 24, 2023 @05:48AM (#34502027)
The current (and very recently updated) OWASP recommendation[1] is a minimum of 600 000 iterations

[1] https://cheatsheetseries.owasp.org/cheatsheets/Password_Stor...

Re:Bitwarden Design Flaw by Daunk on Tuesday January 24, 2023 @06:11AM (#34502172)
I read that as a "total of 600 000" iterations, so 300 000 locally and 300 000 on the server. Am I wrong?
Re:Bitwarden Design Flaw by ajb on Tuesday January 24, 2023 @07:02AM (#34502534)
According to the OP article, the server side iterations are ineffective for adding security in bitwarden, so you need 600,000 on the client. This would not be the case if the design was correct.

(I'm not a security expert, so I'm going by the article)

Re:Bitwarden Design Flaw by justusthane on Tuesday January 24, 2023 @07:07AM (#34502572)
The whole point of the linked article is that the due to a BitWarden design flaw the server iterations are meaningless — only the client iterations count.
Re:Bitwarden Design Flaw by Kuinox on Tuesday January 24, 2023 @07:40AM (#34502853)
I've set it up to 2 millions when I created my account. My OnePlus2 freeze for 10 seconds when logging in ^^'.
Re:Bitwarden Design Flaw by fencepost on Wednesday January 25, 2023 @01:58PM (#34522617)
IMPORTANT NOTE

When you do this reset and sign back into your devices/browser plugins, you will need to go into the Bitwarden Settings on each one and set a few options again - notably timeout (defaults back to Browser Restart, change back to a time you're comfortable with), Biometric Unlock and PIN. All of those are local settings to each Bitwarden client/endpoint, so you need to do them on each device.