-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keyring doesn't know how to disambiguate elements from locked collections. #204
Comments
Here is a sample use case. I used keyring to create two entries. Both entries had empty user and service names, but each entry was given a different target (so they were each created by keyring in a separate collection named for the target). When I use
If I run the
If I then unlock both collections and run the search again, I get a different result:
And, as you might expect, running the
Interestingly, the secret service seems to have a cache of some kind in place, because even if I re-lock the two collections both
and (after throwing a prompt to unlock the collection)
FWIW, I suspect the locked behavior is related to this issue and this issue in the Gnome secret service implementation, and the fix for them probably introduced the caching behavior. |
Given that keyring v2.0 was released on 18 Feb 2023 (18 months ago), it's likely that any v1-written credentials in the wild are at least a year old. So I think it's probably safe now to include the target attribute in the original search, which would fix this bug. Then, to maintain backward compatibility with v1, if the target being searched for is the default (the v1 secret-service implementation broke on non-default targets), a follow-up search with no target can be done. |
That would explain a lot. I'll try to leave my dev VM in this broken state as long as I can for debugging. In fact, I'll see if I can snapshot it. |
I've decided that it's better to keep the code simple (and efficient) by always including the target in the secret-service search unless the entry that's being searched for was explicitly created with no target. This means that those clients who want their secret-service v1 credentials found by v3 must use platform-specific code to create their entries (because all the platform independent code will use a default target). To reduce the burden on secret-service client code that cares about v1 credentials, I have added an entry to the secret-service implementation that makes it easy for them to create "no-target" (v1-compatible) credentials, and I have added code to the CLI the uses this new entry if a new My recommendation to secret-service clients of keyring is that they upgrade their v1 credentials automatically. This can be done by finding them, reading their passwords, deleting them, and finally creating v2/v3 entries with the default target and matching service/user names that have the matching passwords. Note that the order of these operations is important in order to avoid ambiguity when looking for the v1 credentials. There are also functions |
@ReactorScram I've released v3.2 which fixes this bug. I believe the keyring client code in Firezone will just work correctly on your dev machine once you integrate the new release. |
Yep that fixed it on the dev machine! I'm getting a PR open for Firezone, thanks so much! |
As reported in the commentary on #201, the Gnome implementation of the secret service obfuscates the attribute values of searched-for credentials in locked collections. This causes keyring to fail at disambiguating these results based on the target attribute, and it falsely reports ambiguous results when it should not do so.
The text was updated successfully, but these errors were encountered: