Skip to content
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

Ignore repeat characters in "Also choose from" in Password Generator #9797

Closed
yanisallouch opened this issue Aug 27, 2023 · 5 comments · Fixed by #9803
Closed

Ignore repeat characters in "Also choose from" in Password Generator #9797

yanisallouch opened this issue Aug 27, 2023 · 5 comments · Fixed by #9803

Comments

@yanisallouch
Copy link

Overview

I noticed that if I put too much character in the password generator feature titled "Also choose from". The password quality of the generated password get weak. In fact, the password is composed of one character of each character set and filled with the one character given multiple time in the field "Also choose from".

Steps to Reproduce

  1. Open Password Generator from the interface
  2. Choose the first three character types
  3. Check "Exclude look-alike character"
  4. Check "Pick characters from every group"
  5. Add the following strings to the field "Also Choose from" after you choose the character types
  • "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"

Expected Behavior

I expect that generated password quality should not be vulnerable when given this "bad" input in the field "Also choose from".

Actual Behavior

Actually, the generated password quality is dependent on the input given on "Also choose from". If the input contains multiple times the same character, then the password quality tends to be weak.

Context

I was generating password for a website who doesn't explicitly share his password policy. Therefore I was trying to generate secure and valid password using the field "Also choose from" but without success. See the website in question :
chrome_FX6XRvqpzM
https://tickets.monuments-nationaux.fr/fr-FR/mon-compte

KeePassXC - Version 2.7.6
Revision: dd21def

Qt 5.15.10
Debugging mode is disabled.

Operating system: Windows 10 Version 2009
CPU architecture: x86_64
Kernel: winnt 10.0.19045

Enabled extensions:

  • Auto-Type
  • Browser Integration
  • SSH Agent
  • KeeShare
  • YubiKey
  • Quick Unlock

Cryptographic libraries:

  • Botan 2.19.3

Operating System: Windows 10 Pro

@droidmonkey
Copy link
Member

Does this happen if you uncheck "pick from every group"? That setting is actually a degrader in password quality and is why it's disabled by default. Same with exclude look alikes.

So you are technically getting what you explicitly asked for.

@phoerious
Copy link
Member

"Also choose from" takes your request quite literally. It will choose from any character entered into the field. If you increase the a priori probability of a character by repeating it multiple times, it will be more likely to end up in the password as well. We could avoid this by reducing the input to only unique characters to ensure they all have the same probability of being picked. On the other hand if you decide to enter such a ridiculous string into the field, then you kind of get what you asked for.

@droidmonkey
Copy link
Member

I'd be in favor of either explicitly preventing duplicates in the choose from field or implicitly ignoring/collapsing them.

@yanisallouch
Copy link
Author

Does this happen if you uncheck "pick from every group"? That setting is actually a degrader in password quality and is why it's disabled by default. Same with exclude look alikes.

So you are technically getting what you explicitly asked for.

"Also choose from" takes your request quite literally. It will choose from any character entered into the field. If you increase the a priori probability of a character by repeating it multiple times, it will be more likely to end up in the password as well. We could avoid this by reducing the input to only unique characters to ensure they all have the same probability of being picked. On the other hand if you decide to enter such a ridiculous string into the field, then you kind of get what you asked for.

When unchecked "pick from every group" and "look alikes," the password generator does not generate strong passwords. I believe this is because the input fields are probabilistic, but this is not mentioned anywhere in the documentation at https://keepassxc.org/docs/KeePassXC_UserGuide#_password_generator or the user interface. I propose updating the documentation to reflect this behavior.

@droidmonkey droidmonkey changed the title Password Generator Quality Ignore repeat characters in "Also choose from" in Password Generator Aug 27, 2023
@droidmonkey droidmonkey added this to the v2.8.0 milestone Aug 27, 2023
@phoerious
Copy link
Member

The issue is always there. Pick from every group only makes it worse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants