Kunzisoft / KeePassDX

Lightweight vault and password manager for Android, KeePassDX allows editing encrypted data in a single file in KeePass format and fill in the forms in a secure way.
https://www.keepassdx.com/
GNU General Public License v3.0
4.35k stars 262 forks source link

Purposely Duplicated Auto-type Sequences are removed upon saving on KeepassDX #997

Closed afonsoc12 closed 3 years ago

afonsoc12 commented 3 years ago

Describe the bug Specific auto-type sequences from KeepassXC are removed if they are duplicated with different auto-type sequences. For example, Gmail may sometimes ask for my username and password (sequence would be {USERNAME}{ENTER}{DELAY2000}{PASSWORD}{ENTER}) an on other instances only password (sequence would be {PASSWORD}{ENTER}).

Therefore, in KeepassXC I have two entries to match this, where the Window title is in both "Gmail". However, one uses the default sequence (first case) and the other uses a custom sequence (second one).

When I sync this with GDrive, open with KeepassDX and update ANY entry, this leads to the removal of all duplicated auto-type sequences. It seems that KeepassDX is removing duplicates, even though in my case they are purposely duplicated.

To Reproduce Steps to reproduce the behaviour:

  1. Create an entry on KeepassXC and two auto-type sequences, with the same window title.
  2. Sync it with a cloud provided (only tested with GDrive)
  3. Make any change on the database (it can be on any entry) and save it.
  4. Open it back with KeepassXC and the auto-type sequences where removed.

Expected behaviour Should maintain autotype sequence, but removes duplicated entries

KeePass Database

KeePassDX (please complete the following information):

Android (please complete the following information):

Thanks for looking into this!

J-Jamet commented 3 years ago

I just tested the auto-type property save and it works fine. Have you tested it with a local database without using Google Drive? Because I think the Google Drive application just didn't update your database.

afonsoc12 commented 3 years ago

It indeed updated because I can see a new entry. Did you create two window associations with the same name? Please take a look at the following screenshots: First I created this entry on macOS KeepassXC. Note the two window associations Screenshot 2021-05-25 at 19 28 23

Synced it with GDrive and opened on KeepassDX. Here I created the other entry, and saved it. I cannot show prints from phone because it does not allow to take them due to "privacy reasons".

Then I opened the file again on KeepassXC and it removed one of the window associations: Screenshot 2021-05-25 at 19 27 47

afonsoc12 commented 3 years ago

I have noticed that if I have slightly different window association names, it does not delete. My current work around is to add the window association as follows:

Please do let me know if you were able to reproducs it

J-Jamet commented 3 years ago

Okay, I see what the problem is. In KeePassDX, auto-type data is stored in hashmap, and a unique key can only be added once. I'll replace the format with an array, that should solve the problem.

afonsoc12 commented 3 years ago

Hi,

Thanks for looking into this. It makes sense now, and it then saves it to file since the hashmap is different.

But keepassdx does not use this autotype data, right? I mean, it loads from the file but does not use it in the frontend? The same for tags: I used to use Macpass, which uses tags, but keepassdz does not use them.

I will be expecting the next release.

Great work!👍 Em 26/05/2021, 09:21 +0100, Jérémy JAMET @.***>, escreveu:

Okay, I see what the problem is. In KeePassDX, auto-type data is stored in hashmap, and a unique key can only be added once. I'll replace the format with an array, that should solve the problem. —You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.

J-Jamet commented 3 years ago

Indeed, the auto-type is not used in KeePassDX, the data are for the moment only stored to be restored, could be used for the autofill but it is already necessary to manage the placeholders. TAGs are planned and will be present soon. https://github.com/Kunzisoft/KeePassDX/issues/633