Skip to content

Safe handling of KeepassXC database password #983

Closed

Description

@chrisma

Extension – KeepassXC

Author: @zkytech

Description

image

The extension requires adding the password to the KeepassXC database in the preference dialogue.

The current behavior

In order to unlock the database, the extension uses the call exec('echo "${dbPassword}" | "${keepassxcCli}" locate "${database}" /'), see here.
Passing cleartext ${dbPassword} is not best practice and might compromise the password.

The expected behavior

Instead of requiring the plaintext password in the preferences, fetching all entries and rolling its own cryptography, the extension could, for example, use the KeepassXC-CLI open command to open an interactive session (prompting for the password if required) and issue further commands (e.g. to copy pw to clipboard) using this connection.

Raycast version

Version: 1.29.1

Activity

  1. added
    bug
    extension
    on Feb 24, 2022
  2. zkytech commented on Feb 25, 2022

    @zkytech
    Contributor

    Since this is an extension, it’s impossible to keep the a shell session alive on background.
    So user will be required to input the main password every time when activate this extension.

    A better solution is to build an independent keepass client with js, which maybe far more complex than current solution.

  3. thomaspaulmann commented on Feb 25, 2022

    @thomaspaulmann
    Member

    FYI the password is stored in our encrypted database. The extension can then read it from there. So it isn't really clear text.

  4. thomaspaulmann commented on Feb 25, 2022

    @thomaspaulmann
    Member

    I'm not sure how the UX would be if you have to prompt all the time for the password.

  5. chrisma commented on Feb 25, 2022

    @chrisma
    Author

    Thanks for the fast responses!

    I wanted to bring this up, as the security of the password to the password manager (that might store important stuff) is highly relevant. I appreciate the fact that the provided user pw is stored in encrypted form, but that still means that the overall security of the KeepassXC password store (e.g. AES256 with key transformations) is then equivalent to the cryptography implementation used in Raycast to encrypt the password.

    Furthermore, if I'm reading the code correctly exec('echo "${dbPassword}" | "${keepassxcCli}" locate "${database}" /') calls out to the command line with the cleartext password. Therefore, it might be logged or snooped on by any process running at the same time (ps).

    Maybe we could add some of this info on how the extension works and stores the password to the extension information, so that users may be aware?

  6. zkytech commented on Feb 26, 2022

    @zkytech
    Contributor

    #996 Replaced echo with stdin.write . Password will not be snooped.

  7. zkytech commented on Feb 26, 2022

    @zkytech
    Contributor

    Password Security Note has been add to README.md

  8. added a commit that references this issue on Sep 11, 2025
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

    bugextension

    Type

    No type

    Fields

    Priority

    None yet

    Severity

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions