* Fix use-after-free when a database tab close is re-entered Closing a database tab may spin a nested event loop while the widget performs save-on-close (Database::save waits for its worker thread in AsyncTask::waitForFuture). If DatabaseTabWidget::closeDatabaseTab is re-entered for the same widget from within that nested loop (e.g. two concurrent FdoSecrets prompts deleting the same collection), QWidget::close() short-circuits on its internal is_closing flag and reports success immediately, without delivering another close event. This behavior is identical in Qt 5 (QWidgetPrivate::close_helper) and Qt 6 (QWidgetPrivate::handleClose), so none of the downstream guards (such as DatabaseWidget::lock's m_attemptingLock) ever run for the re-entrant close. The re-entrant call then removed the tab and scheduled deletion, and the DeferredDelete event executed inside the still-running nested loop, destroying the widget while the outer invocation was still using it; the outer call afterwards repeated parts of the teardown (stale-index removeTab, deleteLater on the freed widget, duplicate databaseClosed emission). The bug is long-standing and was surfaced by scheduler timing under an ASan build with Qt 6.11. Detected by ASan as a heap-use-after-free in DatabaseWidget::save() during TestGuiFdoSecrets::testCollectionDeleteConcurrent. - DatabaseTabWidget::closeDatabaseTab: track widgets with a close in progress; a re-entrant call returns false without side effects, and only the outermost invocation may remove the tab, schedule deletion, and emit databaseClosed (exactly once now). Re-resolve the tab index after close() since nested event loops may shift tabs. - FdoSecrets: PromptBase::prompt now schedules promptSync only once; repeated Prompt() calls wait for the same Completed signal instead of running the prompt action multiple times. - FdoSecrets: DeleteCollectionPrompt clears its collection reference on Collection::collectionAboutToDelete. The QPointer alone still sees a retired collection (removed from D-Bus, m_backend already reset) until its deleteLater is delivered, which would violate the invariant behind Q_ASSERT(m_backend) in Collection::doDelete. With the explicit clearing the invariant "non-null m_collection implies usable backend" holds again and the assert stays. - TestGuiFdoSecrets::testCollectionDeleteConcurrent: fix the second prompt proxy accidentally created from the first prompt's path (the test was exercising a double-Prompt on one object rather than two concurrent prompts), and assert the fail-fast behavior: the losing concurrent prompt completes as dismissed while the winner performs the deletion. * FdoSecrets: complete prompts whose collections retire mid-prompt A Collection retires (removed from D-Bus, backend reset, deleteLater scheduled) synchronously when its database closes. Prompts, however, reference collections via QPointer from timer callbacks outside D-Bus dispatch, and a QPointer still sees the retired object until its deferred deletion is delivered. This left two holes, both reachable when a collection goes away while a prompt targeting it is in flight (e.g. a concurrent Collection.Delete from another client): - LockCollectionsPrompt/UnlockPrompt could call doLock()/doUnlock() on a retired collection, hitting Q_ASSERT(m_backend) in debug builds. - UnlockPrompt would hang forever: the retired collection never emits doneUnlockCollection (its service connections are severed on retirement), and the count-based completion condition could no longer be satisfied, so the Completed signal never fired and the client waited indefinitely. The same accounting also hung when an entry was already destroyed by the time promptSync ran. Following the same principle as DeleteCollectionPrompt: restore the invariant that a non-null collection reference is usable, instead of relaxing the asserts. - LockCollectionsPrompt clears retired collection references on collectionAboutToDelete; a retired collection is skipped exactly like a destroyed one. - UnlockPrompt tracks awaited collections in an explicit pending set, pre-registered before issuing any doUnlock so that synchronous completions (already-unlocked databases) cannot prematurely trigger the item unlock step. Retirement is accounted as a rejection and re-evaluates completion, so the prompt always terminates. - Add regression test testServiceUnlockConcurrentDelete covering the unlock/delete race; verified to fail (hang detected via signal spy timeout) without this fix. * FdoSecrets: clean up unlock dialog bookkeeping when the widget dies Service::m_unlockingDb tracks databases with an unlock dialog shown to prevent duplicate dialogs. If the DatabaseWidget is destroyed while its dialog is open (e.g. the database is deleted via a concurrent D-Bus call), dialogFinished never fires for it and the entry stayed forever, keyed by a dangling pointer. The pointer was only ever compared, not dereferenced, but the stale entry permanently blocked doUnlockAnyDatabaseInDialog (used by unlock-before-search), and a future widget allocated at the same address would have been refused an unlock dialog as well. Track a cleanup connection on the widget's destroyed signal alongside the existing databaseUnlocked oneshot, covering both the per-database and the unlock-any-database flows. Extend the testServiceUnlockConcurrentDelete regression test to reopen the database after the concurrent delete and verify the unlock dialog still appears; without the fix the test times out in SearchItems waiting for a dialog that never shows. --------- Co-authored-by: Claude Fable 5 <[email protected]>
KeePassXC
KeePassXC is a modern, secure, and open-source password manager that stores and manages your most sensitive information. You can run KeePassXC on Windows, macOS, and Linux systems. KeePassXC is for people with extremely high demands of secure personal data management. It saves many different types of information, such as usernames, passwords, URLs, attachments, and notes in an offline, encrypted file that can be stored in any location, including private and public cloud solutions. For easy identification and management, user-defined titles and icons can be specified for entries. In addition, entries are sorted into customizable groups. An integrated search function allows you to use advanced patterns to easily find any entry in your database. A customizable, fast, and easy-to-use password generator utility allows you to create passwords with any combination of characters or easy to remember passphrases.
Quick Start
The QuickStart Guide gets you started using KeePassXC on your Windows, macOS, or Linux computer using pre-compiled binaries from the downloads page. Additionally, individual Linux distributions may ship their own versions, so please check your distribution's package list to see if KeePassXC is available. Detailed documentation is available in the User Guide.
Features List
KeePassXC has numerous features for novice and power users alike. Our goal is to create an application that can be used by anyone while still offering advanced features to those that need them.
Core Features
- Create, open, and save databases in the KDBX format (KeePass-compatible with KDBX4 and KDBX3)
- All information is encrypted at rest and never exposed outside the program
- Store sensitive information in entries that are organized by groups
- Password generator
- Search for entries
- TOTP storage and generation
- YubiKey/OnlyKey challenge-response support
- Auto-Type passwords into applications
- Browser integration with Google Chrome, Mozilla Firefox, Microsoft Edge, Chromium, Vivaldi, Brave, and Tor-Browser
- Support for passkeys using the browser integration
- Entry icon download
- Import databases from CSV, 1Password, Bitwarden, Proton Pass, and KeePass1 formats
Advanced
- Database reports (password health, HIBP, and statistics)
- Database export to CSV, XML, and HTML formats
- TOTP storage and generation
- Field references between entries
- File attachments and custom attributes
- Entry history and data restoration
- Command line interface (keepassxc-cli)
- SSH Agent integration
- FreeDesktop.org Secret Service (replace Gnome keyring, etc.)
- Additional encryption choices: Twofish and ChaCha20
For a full list of changes, read the CHANGELOG document.
For a full list of keyboard shortcuts, see KeyboardShortcuts.adoc
Building KeePassXC
Detailed instructions are available in the Build and Install page and in the Wiki.
Contributing
We are always looking for suggestions on how to improve KeePassXC. If you find any bugs or have an idea for a new feature, please let us know by opening a report in the issue tracker on GitHub, or join us on Matrix community channel or Matrix development channel, or on IRC in Libera.Chat channels #keepassxc and #keepassxc-dev.
You may directly contribute your own code by submitting a pull request. Please read the CONTRIBUTING document for further information.
Contributors are required to adhere to the project's Code of Conduct.
Generative AI
Generative AI is fast becoming a first-party feature in most development environments, including GitHub itself. If the majority of a code submission is made using Generative AI (e.g., agent-based or vibe coding) then we will document that in the pull request. All code submissions go through a rigorous review process regardless of the development workflow or submitter.
License
KeePassXC code is licensed under GPL-2 or GPL-3. Additional licensing for third-party files is detailed in COPYING.