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

Crash while loading key #420

Open
altheeagle opened this issue Sep 16, 2024 · 11 comments
Open

Crash while loading key #420

altheeagle opened this issue Sep 16, 2024 · 11 comments

Comments

@altheeagle
Copy link

I'm in the Manage KeeAgent Window and want to load a Key from KeyPass via the + Symbol I get an Exception:

grafik

Its in German but it translates to:
Unhandled exception in the application. Click 'Continue' to ignore the error and continue the application. If you click 'Exit', the application will exit immediately.

Here is what you get when you click on details:
KeeAgent_exception.txt

@dlech
Copy link
Owner

dlech commented Sep 18, 2024

It sounds like you have invalid XML in your KeePass setting file. You should be able to open that file with a text editor and fix it.

In KeeAgent, the best we could do is catch that exception so that it doesn't crash the whole program and fall back to default settings.

@altheeagle
Copy link
Author

Thank you for the response. Are you referring to the %appdata%\KeePass\KeePass.config.xml? I've renamed my existing file and used a new one and still get this error. Is there another config File that may cause the Problem? Or maybe an entry inside KeePass?

@altheeagle
Copy link
Author

I've got courious and investigted more. It seems that the attached file KeeAgent.settings caused the problem. I attach a modified version of that file to this Post.
KeeAgent.settings.txt
I have no clue where it came from, but after I deleted it everthing works as expectet.
Thanks again for your help and the great work you do here! :)

@dlech
Copy link
Owner

dlech commented Sep 19, 2024

It looks like you might have accidentally saved a SSH key over the KeeAgent.settings file. Glad to hear you got it working.

@mechgt
Copy link

mechgt commented Dec 26, 2024

there's something bad wrong here I suspect, not accidental user error - I have the same issue and found numerous mangled entries after using this for many years. As of the past month or two I'm also getting many UI crashes. I just looked, and I've now found key files (e.g. id_rsa.txt) that now contain settings XML content, keepass settings files that contain ssh key info, and suspect I've now lost several private keys.

My attachments have been collected over the years and are often either a single file, have funny names, or other nuances that may not fit parsing rules in case that's relevant.

@mechgt
Copy link

mechgt commented Dec 29, 2024

Likely the same issue: #422 (comment)

@mechgt
Copy link

mechgt commented Jan 3, 2025

I found a .kdbx backup from about a week prior to the plugin upgrade to ver. 0.13.8 and the corruptions weren't present. Something in the latest version caused the attachment key files to become corrupted mangling several private keys (overwrite them with keepass.settings style XML content).

@mechgt
Copy link

mechgt commented Jan 6, 2025

An example summarizing how in this example case the file content was 'rotated'. Nothing was lost in this example, but the content of all 3 files have been shuffled.
compare2
I suspect that another action could cause the keepass.settings file to get overwritten causing data loss.

@altheeagle
Copy link
Author

Today I found that a lot of files in completly different Groups of my Keepassfile has been changed to an file with this or similar Content:
<?xml version="1.0" encoding="utf-16"?> <EntrySettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <AllowUseOfSshKey>true</AllowUseOfSshKey> <AddAtDatabaseOpen>true</AddAtDatabaseOpen> <RemoveAtDatabaseClose>true</RemoveAtDatabaseClose> <UseConfirmConstraintWhenAdding>false</UseConfirmConstraintWhenAdding> <UseLifetimeConstraintWhenAdding>false</UseLifetimeConstraintWhenAdding> <LifetimeConstraintDuration>600</LifetimeConstraintDuration> <UseDestinationConstraintWhenAdding>false</UseDestinationConstraintWhenAdding> <DestinationConstraints /> <Location> <SelectedType>attachment</SelectedType> <AttachmentName>private.ppk</AttachmentName> <SaveAttachmentToTempFile>false</SaveAttachmentToTempFile> <FileName>C:\Users\xxx\Documents\private.ppk</FileName> </Location> </EntrySettings>

It seems that the addon has overwritten other files in my Keebase database at some point. This is a very serious problem. In a backup of my database from 2023, the files are not corrupted. And the new files from January are also correct. Now I don't know if an update has stopped the overwriting of the files or if I need to trigger the overwriting in some way. It would be great if the developer could answer this.

@dlech
Copy link
Owner

dlech commented Feb 12, 2025

I'm not aware of any changes in KeeAgent that could be triggering this. So without a reproducible test case, I'm not sure how to fix it.

It would help if someone could make a test .kdbx file and give the exact steps needed to reproduce the issue (KeePass version, KeeAgent version, using plgx or dll?, exact order of what to click to trigger the problem).

@altheeagle
Copy link
Author

I‘ll try to reproduce the steps necessary the next days

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

No branches or pull requests

3 participants