Skip to content

KDBX 4: attachments are written twice, into the inner header and into Meta/Binaries (TODO in KdbxStreamFormat.save) #97

Description

@astrapi69

Version 2.2.4, KeePassJava2-kdbx.

KdbxStreamFormat.save (around lines 81-90) copies every binary into the inner header for version 4 and then says:

// TODO the binaries should now be removed so they don't get serialized in XML

They are not removed, so every KDBX 4 file with an attachment carries the binary pool twice. KeePassXC notices on every read. Measured with keepassxc-cli 2.7.10 on a file written by each serializer:

  • SimpleDatabase.save: KdbxXmlReader::parseBinaries: overwriting binary item "0"
  • JacksonDatabase.save: KdbxXmlReader::skipCurrentElement: skip element "Binaries"

The attachment itself reads back correctly in both cases (from the inner header). The warning and the duplicated bytes remain.

Would removing the Binaries from the serializable database after they are moved into the header, for version 4, be the fix you intended by the TODO?

Context: astrapi69/mystic-crypt-ui#379.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions