Skip to content

Corrupted database: Saving with a non existent keyfile #223

Description

@A6GibKm

In password safe, after opening a keyfile/composite database, if one renames the keyfile, introduces some change and then proceeds to save (a call to save() in pykeepass) the safe could result corrupted in certain scenarios, which would result of a crash when opening it.

Sometimes it would be corrupted and sometimes it wont, making me think that this block

            try:
                self.db.save()
                logging.debug("Saved database")
            except Exception:
                logging.error("Error occurred while saving database")

does not accomplish its purpose as some part of db.save() happens before checking if the keyfile actually exists.

See https://gitlab.gnome.org/World/PasswordSafe/-/merge_requests/434 and its corresponding issue.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions