Live data from Hacker News

Bitwarden design flaw: Server side iterations

palant.info

71–80 of 264 posts

Re: Bitwarden design flaw: Server side iterations

#71
- PBKDF1 (1.0 ?, 1.5 1993)

- PBKDF2 (2.0 2007 RFC 2898, 2.1 2017 RFC 8018) - bcrypt (1999)

- scrypt (2009)

- argon2id (2015) What about minimum resource complexity (mem-/CPU-/GPU-/FPGA-/ASIC-hard) guarantees on the client (assumed trusted, as much as one can trust)?

Picking one number out of the sky for today that doesn't evolve with technology doesn't make sense. Plus, it isn't necessarily something a human shouldn't be choosing for every use-case without a risk assessment. There should be a sanity-check lower bound that evolves with best-case performance coupled with a specific threat environment.

Calculator website with:

1. "Which algorithm?" (some choices)

2. "What type of data is it?" (Level 1 - 6 with familiar descriptions)

3. "How long does it need to be protected?" (1...100 years in almost log progression)

4. "How much is the data worth?" (some choices, or 1e2 ... 1e11 USD / other currencies)

5. "What would be the consequences of its disclosure?" (with familiar descriptions)

6. "What model of device will slower users have?" (some choices of new to old laptops and touch devices)

7. "Funding amount of highest reasonable threat actor?" (some choices, or 1e5 ... 1e12 USD / other currencies)

8.-11. "What is a(n) {un,}reasonable {un,}lock delay?" (ms)

And then output parameters (n, salt/nonce sizes, factors) and password complexity requirements valid for implementation now.

It would also be nice to output an algorithm generated to forecast values needed X years in the future with similar guarantees.

Re: Bitwarden design flaw: Server side iterations

#72
post #11

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... (or if you don't trust links for something like your password manager: log into your web vault, click on the top-right dropdown menu, then Account settings > Security > Keys). I've updated it to 600,000 iterations…

I upped mine to more than 1M and haven’t seen any degradation of performance.

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: Server side iterations

#73

Earlier quoted context omitted.

Can someone Eli5 iterations in this context?

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 t…

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: Server side iterations

#74
post #63

> Even if you configure your account with 1,000,000 iterations, a compromised Bitwarden server can always tell the client to apply merely 5,000 PBKDF2 iterations to the master password before sending it to the server. The client has to rely on the server to tell it the correct value, and as long as low settings like 5,000 iterations are supported this issue will remain. This seems like a serious flaw that completely…

The only way around this would be to require a human to set the # of iterations independently on all client devices. Because if you change the # of iterations using your laptop, the server wouldn't be able to tell your phone that the # of iterations has changed. Instead you just wouldn't be able to log in until you ALSO manually changed that setting on your phone to match the new server configuration that you set with your laptop.

That would be pretty poor UX.

So yes, it's a flaw. But I don't see an acceptable mitigation for it, as all clients will have to be compatible with passwords for accounts that were last logged into 10 years ago when [super_low_iteration_number] was still considered an acceptable value. And the server will have to be able to tell the client "This account was last logged into 10 years ago. We're going to increase the number of iterations right after this, but just one last time, send me the password after hashing it 5,000 times."

Re: Bitwarden design flaw: Server side iterations

#75
post #49

Earlier quoted context omitted.

But what if you need to enter it somewhere that doesn't support it? A physical device, a VM that doesn't allow copy and paste, a mobile app without support for copy/paste or password managers... All those scenarios happen for me every couple of weeks and it's what's keeping me from using really long passwords with high complexity.

Using a passphrase is the way to go. Easy to type, remember, and more secure. Obligatory xkcd: https://xkcd.com/936/

You're assuming that a) a passphrase is acceptable to the system/app and b) that people can competently pick words for a passphrase.

That damn XKCD is overly simplified at best. I really wish people would stop linking to it.

Re: Bitwarden design flaw: Server side iterations

#76

Why is the iteration needed if I choose sufficiently strong passphrase? Think 40 characters

It's not really needed if your password has a lot of entropy. 40 random characters is like 256 bits or something so that's crazy overkill and would be safe regardless of how many iterations.

Re: Bitwarden design flaw: Server side iterations

#77

tl;dr rant, and not an exaggeration: the amount of time I've spent skimming these (edit to be nicer) exhausting comment threads about password managers has taken 10x the amount of time it took to use a pass-compatible or age-based password manager. Okay, here we go, let me be explicit: there's a Venn diagram I imagine in my head of two circles - first is "password managers that require a web ui and browser integratio…

> luckily recently there is a tool which is,

...and that is???

Re: Bitwarden design flaw: Server side iterations

#78

Earlier quoted context omitted.

Unless you have a high-entropy long password. 10 Diceware words (words chosen uniformly at random from a list of 7776 words) is over 128 bits of entropy, even a very fast hash would be enough for such a passphrase. Of course at that point you've essentially memorized a cryptographic key, not a traditional low-security password. Good for the master password of a password database, not so usable anywhere else.

I'm not super practiced in hashing theory. If the 10 words were usually longer than the hash function output (say, starting at an average of 7 words), would adding more characters (words) still increase the entropy or would the entropy get truncated?

It will theoretically increase the entropy until the total entropy exceeds the length of the hash (not the total length of the input).

What we really care about is how hard it is to determine the passphrase given the hash. With a 128 bit hash, an attacker requires an average of 2^127 guesses if they are guessing completely randomly. So as long as your passphrase is well before the first 2^128 guesses an attacker is likely to make, making it harder to guess is theoretically useful.

For example, "AAAAAAAAAAAAAAAAAAAAAAAAAAA" has more than 128 bits, but it's also going to be (relatively) easy to guess. As shorthand we say "it has less than 128 bits of entropy"

In the example that GP gave, you could advertise "I used 10 diceware words for my passphrase" and it would still be as hard for the attacker as attacking a 128 bit hash. 7 diceware words would be much longer than 128 bits, but if you advertised "I used 7 diceware words" it would give the attacker a significant advantage, since there are much less than 2^128 possibilities.

Re: Bitwarden design flaw: Server side iterations

#79
post #49

Earlier quoted context omitted.

Using a passphrase is the way to go. Easy to type, remember, and more secure. Obligatory xkcd: https://xkcd.com/936/

You're assuming that a) a passphrase is acceptable to the system/app and b) that people can competently pick words for a passphrase. That damn XKCD is overly simplified at best. I really wish people would stop linking to it.

Please elaborate, how can you pick bad words for a passphrase? (Except obviously a movie title or an everyday sentence)

Like, if I go "street bologna drawer sunset fang", did I do well?

Re: Bitwarden design flaw: Server side iterations

#80

Embarrassments will continue until everyone realizes all the "security experts" recommending password managers have marketing deals with them. Password managers are an awful antipattern, I've been saying it for years, and it's absolutely comical to me that people do not get the message. When one falls, it's "oh that one sucked, use this other one instead". An Internet-connected data vault is subject to attack from an…

What about offline only managers?
Post reply on HN