Conversation
…ss chains in CustomData When an application or CLI helper process queries secrets via FdoSecrets, KeePassXC previously lost authorization as soon as the client disconnected from D-Bus, causing repeated access confirmation prompts on subsequent invocations even with the "Remember" option enabled (Fixes keepassxreboot#8784). This commit resolves the issue by securely persisting authorized process chains: 1. Construct a portable, path-independent process hierarchy identifier in PeerInfo::chainIdentifier() using executable names (resilient across different Linux filesystem layouts, including NixOS). 2. Store authorized process chains inside the entry's encrypted CustomData under 'FDO_SECRETS_AUTH_CHAINS'. 3. Verify process chain authorization in Item::locked() and during secret retrieval, suppressing the prompt dialog if the caller's ancestry matches. 4. Automatically persist the chain when access is granted with "Remember" checked.
|
Handled in #13610 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Fixes #8784
When applications or CLI helper processes query credentials via the Secret Service API (
FdoSecrets), KeePassXC prompts for confirmation on every execution or restart, even when the user checks "Remember".Problem
Client authorizations are currently stored only in memory (
DBusClient::m_allowed), mapped to the ephemeral D-Bus address (:1.xxx). When the client disconnects,DBusMgr::dbusServiceUnregistereddestroys the client instance and its permissions. For short-lived helper processes, every call uses a new PID and D-Bus address, so the "Remember" checkbox does not survive across invocations.Changes
PeerInfo::chainIdentifier):Constructs an ancestry string from
info.hierarchyusing process executable names (e.g.parent->caller). Rootsystemd/initprocesses are excluded. UsingQFileInfo::fileName()ensures portability across standard filesystem hierarchies and content-addressed layouts like NixOS.CustomData(CustomData::FdoSecretsAuthChains):When access is granted with "Remember" checked, the chain is appended to the target entry's
CustomDataunderFDO_SECRETS_AUTH_CHAINS(visible in GUI under Edit entry -> Properties -> Plugin Data).\n), allowing multiple distinct workflows (e.g. an IDE subprocess and a terminal shell) to be authorized concurrently for the same credential without overwriting each other.Item::locked()andUnlockPrompt::unlockItems()check if the caller's process chain is listed in the entry'sCustomData. If matched, access is granted directly without showingAccessControlDialog.AI Usage Disclosure
In accordance with the project's Contributing Guidelines, this change was developed with the assistance of an AI coding agent (Oh My Pi using Google Gemini 3.8 Flash). The implementation was formatted with
git clang-formatand verified under Linux (Wayland).Screenshots
Testing strategy
secret-tool lookup service <name>).FDO_SECRETS_AUTH_CHAINSappears in the entry properties under Plugin Data and the database is saved.FDO_SECRETS_AUTH_CHAINSon a new line alongside the existing one. Both callers now have seamless access.Type of change