Secret Service Integration: fix all exposed entries are returned if search with empty terms #4008
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.
Type of change
Description and Context
When using
secret-tool
or any other client to search the database via secret service API, KeePassXC will return all exposed entries if the searching terms contain onlyPassword
.Example:
secret-tool search --all Password abc
The intended behavior is to not allow searching by password at all. Because the terms are passed in clear text which is insecure. In the implementation, any term matching
Password
is skipped. But if that is the only term, an empty term list is passed toEntrySearcher
, which will return all entries.This fix checks if the term list is empty and return not found if it is.
Testing strategy
Tested manually by
Nothing should be returned.
Checklist:
-DWITH_ASAN=ON
. [REQUIRED]