kylemanna / keepassx

🔑 This fork adds YubiKey support
https://github.com/keepassx/keepassx/pull/52
Other
38 stars 5 forks source link

Possible data loss when database is closed while YubiKey is unplugged #4

Closed fabian-z closed 9 years ago

fabian-z commented 10 years ago

When the YubiKey is not plugged in while closing the database and one decides to save the changes, the error message ("Unable to issue challenge-response") will appear but closing the database will proceed afterwards, losing the previous changes since the last save.

Steps to reproduce: 1) Open challenge-response secured KDBX. 2) Change any entry (remove, add, etc.) 3) Unplug YubiKey 4) Try to close the database, selecting Yes when asked if you want to save changes. 5) Closing the database will proceed after an error message. Changed entry from 2. will be lost/unchanged.

Expected Behaviour: Stop database close if an error during saving occurs. The user can re-plug his YubiKey afterwards, save and retry to close the database afterwards.

fabian-z commented 9 years ago

I recently encountered a case where the above steps lead to complete corruption of the database file (unable to open) again instead of only losing the unsaved entry. It somehow did not happen during testing but way later in every day use and I couldn't reproduce it so far. Lucky me I do regular backups :smile:

kylemanna commented 9 years ago

That's not good! Hopefully you didn't lose anything.

What was the underlying filesystem and storage device?

It's good to keep a record of the frequenency of these issues here. If you can determine a way to re-create it, I'll definitely look in to it.

kylemanna commented 9 years ago

Just rebased the fork on top of the upstream master. There are some fixes in there to prevent this from happening. Please test and re-open if you encounter the issues still!