-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit size of password sent to zxcvbn to prevent lock ups #7712
Comments
Agree that we should just truncate that input to zxcvbn at some length (probably 999). This requires explanation:
|
why is it even worth bothering to calculate entropy of anything that long? i.e. how is any attacker going go about "guessing" 1 kilobyte of text? the authors of zxcvbn suggest 100 characters:
not sure why it doesn't just bail itself and return entropy as something as
not sure what explanation you want... some arbitrary program (I think it's minecraft) uses the freedesktop Secrets API to store multiple values in a manner as suggested by the spec:
in practice it's using JSON to encode these values, and maybe pushing the spec a bit far by wanting to store that much, but otherwise it seems OK |
It's not worth it, but trust me when I say some of our users are... excessive... and VERY vocal about it. Why do you think we even allow passwords with length 999? That was a very dramatic conversation between multiple parties demanding passwords of length greater than 128 characters. |
you should certainly allow password entries of arbitrary length, not sure why you think I don't like that it's just estimating entropy of long passwords via the |
Passwords of that length are useless. Anything that has a larger keyspace than the hash derived from it is a waste of space and computing time. |
@phoerious yup, wanting more than 256 bits of entropy in your secret seems to be considered meaningless, hence why it's the highest security target of sane cryptographic systems at the moment. but these entries aren't passwords in any conventional sense, but they should be considered sensitive and hence it makes sense to look after them, just not calculate entropy @droidmonkey I've have had a quick play, and the following Python code can be used generate a password that can take many seconds to calculate: base64.b64encode(random.randbytes(num_bytes)) setting estimating entropy via the code I gave above in Python, i.e.: math.log2(len(set(pwd))) * len(pwd) gives a good approximation to
note that these are random bytes, so there will be some variance, but they track each other pretty well hence it seems reasonable to use this for "long" passwords |
If you store things that are not passwords in KeePassXC, I would suggest using appropriately named custom string fields instead. |
Or attachments or notes |
I'm not setting them myself, they're coming from other programs via your "secret service" integration. I've had a look in your source code, and it looks like |
that said, the UI shouldn't lock up for a minute if the user accidentally copy/pastes a long value into a field... |
the upstream package tsyrogit/zxcvbn-c#28 made a change that returns results in milliseconds now, it might be easier to just pull in the latest version of their code |
Limit the use of zxcvbn based password entropy estimation to 256 bytes. After this threshold, the average per-byte entropy from the zxcvbn calculation is added for each additional byte. In practice, this produces a slightly higher entropy calculation for purely randomized passwords than zxcvbn would normally calculate. However, the time to calculate is capped leading to a much better user experience and removing unnecessary calculations. Fixes keepassxreboot#7712
Limit the use of zxcvbn based password entropy estimation to 256 bytes. After this threshold, the average per-byte entropy from the zxcvbn calculation is added for each additional byte. In practice, this produces a slightly higher entropy calculation for purely randomized passwords than zxcvbn would normally calculate. However, the time to calculate is capped leading to a much better user experience and removing unnecessary calculations. Fixes keepassxreboot#7712
Limit the use of zxcvbn based password entropy estimation to 256 bytes. After this threshold, the average per-byte entropy from the zxcvbn calculation is added for each additional byte. In practice, this produces a slightly higher entropy calculation for purely randomized passwords than zxcvbn would normally calculate. However, the time to calculate is capped leading to a much better user experience and removing unnecessary calculations. Fixes #7712
Limit the use of zxcvbn based password entropy estimation to 256 bytes. After this threshold, the average per-byte entropy from the zxcvbn calculation is added for each additional byte. In practice, this produces a slightly higher entropy calculation for purely randomized passwords than zxcvbn would normally calculate. However, the time to calculate is capped leading to a much better user experience and removing unnecessary calculations. Fixes keepassxreboot#7712
Limit the use of zxcvbn based password entropy estimation to 256 bytes. After this threshold, the average per-byte entropy from the zxcvbn calculation is added for each additional byte. In practice, this produces a slightly higher entropy calculation for purely randomized passwords than zxcvbn would normally calculate. However, the time to calculate is capped leading to a much better user experience and removing unnecessary calculations. Fixes keepassxreboot#7712
Limit the use of zxcvbn based password entropy estimation to 256 bytes. After this threshold, the average per-byte entropy from the zxcvbn calculation is added for each additional byte. In practice, this produces a slightly higher entropy calculation for purely randomized passwords than zxcvbn would normally calculate. However, the time to calculate is capped leading to a much better user experience and removing unnecessary calculations. Fixes #7712
Limit the use of zxcvbn based password entropy estimation to 256 bytes. After this threshold, the average per-byte entropy from the zxcvbn calculation is added for each additional byte. In practice, this produces a slightly higher entropy calculation for purely randomized passwords than zxcvbn would normally calculate. However, the time to calculate is capped leading to a much better user experience and removing unnecessary calculations. Fixes keepassxreboot#7712
Limit the use of zxcvbn based password entropy estimation to 256 bytes. After this threshold, the average per-byte entropy from the zxcvbn calculation is added for each additional byte. In practice, this produces a slightly higher entropy calculation for purely randomized passwords than zxcvbn would normally calculate. However, the time to calculate is capped leading to a much better user experience and removing unnecessary calculations. Fixes #7712
Overview
I enabled "secret service" integration, and some users of this service seem to store some very long JSON objects as their "password". this makes all interactions incredibly slow when the strength meter is enabled.
Steps to Reproduce
create a "password" containing an 8kib password
this causes the UI to hang for a minute or so which doesn't seem great!
Context
can reproduce under Linux (wayland) I've just built from develop branch. issue goes away with:
The text was updated successfully, but these errors were encountered: