keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
21.27k stars 1.47k forks source link

Autotype entry selection based on "Window Associations" does not work for Firefox anymore #8425

Closed agentC333 closed 2 years ago

agentC333 commented 2 years ago

Overview

When using Auto-Type (CTRL+ALT+A.) for Firefox windows all database entries are listed in the auto-type selection dialog, instead of only the ones with the correct "Window Associations".

Steps to Reproduce

  1. Update to 2.7.1 (from 2.6.x)
  2. Add a new entry with password/username
  3. Add a new entry with password/username and add a Firefox Window Association in Auto-Type preferences
  4. Use Autotype for that associated window (CTRL+ALT+A)
  5. Both entries are shown in the dialoag, although only one has the correct "Window Association".

Expected Behavior

For Firefox only the entries with the correct "Window Associations" are shown.

Actual Behavior

Every database entry is listed in the Auto-Type Dialog regardless of any "Window Associations" defined.

Context

I also tested Chrome and other programs, everything works fine. Only Firefox windows don't work.

Debug Info

KeePassXC - Version 2.7.1 Revision: 5916a8f

Qt 5.15.3 Debugging mode is disabled.

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

Enabled extensions:

Cryptographic libraries:

Firefox Version: 104.0 (64-Bit)

phoerious commented 2 years ago

Has Firefox changed the window title? In any case, for browser we recommend our browser extension instead of Auto-Type.

agentC333 commented 2 years ago

Thanks for the hint. It actually was a minor change from "-" to "–". I have a look at the browser plugin.

Best,

newhinton commented 2 years ago

@phoerious Has there been a change on how the auto type entries are matched? To me it seems that some older version (pre 2.7, but i dont know which version exactly, it may have even been post 2.7) used something like "contains", but the current dev-branch uses exact matches. Eg. formerly "PayPal" worked flawlessly, but now i have to use the exact matching window-title to get my custom entry to show up. Albeit the default autotype still shows up.

Edit:

"Log in to PayPal — Mozilla Firefox" is the window title, and using that works, but "Log in to PayPal — Mozilla Firefo" does not.

phoerious commented 2 years ago

Auto-Type has been reworked completely in 2.7 and lets you search entries that don't match. For browsers, I would definitely recommend our browser extension over Auto-Type, though.

newhinton commented 2 years ago

@phoerious I have investigated this a bit, and it seems in d9ae449f0424c7d296a2fd1372d3393b5c7c0152 the Entry.cpp autoTypeSequences() function was reworked. Maybe this does not work as intended?

I know that you recommend the extension, but i dont want to use an extension for many reasons, and it is not only firefox that is not working anymore. I have lot of passwords to type in a konsole-window, which i also match with keywords/strings depending on the window title, those also do not work anymore with no workaround.

Should i open a new issue more fitting for the regex-topic?

phoerious commented 2 years ago

I would say it works as intended. There is the asterisk operator * for matching arbitrary strings.

droidmonkey commented 2 years ago

It matches the behavior of KeePass2 which is an exact match. As stated above, wildcards are supported and should be used.

newhinton commented 2 years ago

Yes, i have now converted all of the affected autotype-entries to a regex.

However, i found the old way of also allowing partial matches to be more intuitive and easy to use, especially for people who dont know regex. But those users would probably not mess around with autotype anyway, so maybe this is moot. Thanks for the help!

phoerious commented 2 years ago

Partial matches create too many false positives and now that you can use the search field to find arbitrary entries even though they don't match, this is the much safer option.

droidmonkey commented 2 years ago

It's wildcard support, not regex. It's also documented in the user guide. https://keepassxc.org/docs/KeePassXC_UserGuide.html#_configure_auto_type_sequences