SearchItems returns no locked items, so libsecret never prompts to unlock
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- rust
調査の方向性
Start with search_inner_items in server/src/collection/mod.rs and trace how SearchItems handles a locked keyring and attribute matching. The issue explains why returning every locked item can expose the wrong secret, so investigate how matching could work while locked. Done means a lookup prompts to unlock the matching item and returns its secret without returning unrelated items; the reproduction uses secret-tool and busctl.
索引モデルが issue の本文から書いたものです。
説明
When the login collection is locked, SearchItems returns both arrays empty, including the locked array. libsecret's secret_password_lookup unlocks an item only when the search reports it in locked. With both arrays empty, it concludes that no matching secret exists. The application is told the secret doesn't exist, with no unlock prompt and no error.
Environment
- oo7
mainat 901e7406 ("python: stop shipping stray type stub files"), plus one unrelated patch that retries the daemon's connect to the login helper at startup - libsecret 0.21.8, with
secret-toolas the client - oo7-daemon as the only Secret Service provider, on a private session bus with an empty
XDG_DATA_HOME. The login collection was unlocked at startup throughoo7-daemon-login.
Steps to reproduce
$ C=/org/freedesktop/secrets/collection/login
$ echo -n topsecret | secret-tool store --label=test service demo key demo
$ secret-tool lookup service demo key demo
topsecret
$ busctl --user call org.freedesktop.secrets /org/freedesktop/secrets \
org.freedesktop.Secret.Service SearchItems "a{ss}" 2 service demo key demo
aoao 1 "/org/freedesktop/secrets/collection/login/1" 0
$ secret-tool lock --collection=$C
$ busctl --user get-property org.freedesktop.secrets $C \
org.freedesktop.Secret.Collection Locked
b true
$ busctl --user call org.freedesktop.secrets /org/freedesktop/secrets \
org.freedesktop.Secret.Service SearchItems "a{ss}" 2 service demo key demo
aoao 0 0
$ secret-tool lookup service demo key demo; echo "rc=$?"
rc=1
The final lookup returns in about 40 ms. No prompt appears and nothing is printed.
The item is still there:
$ busctl --user get-property org.freedesktop.secrets $C org.freedesktop.Secret.Collection Items
ao 1 "/org/freedesktop/secrets/collection/login/1"
$ busctl --user get-property org.freedesktop.secrets $C/1 org.freedesktop.Secret.Item Locked
b true
Expected
SearchItems returns aoao 0 1 "/org/freedesktop/secrets/collection/login/1". libsecret then calls Unlock on that path, the prompter asks for the password, and the lookup returns the secret.
Cause
search_inner_items in server/src/collection/mod.rs returns early while the keyring is locked:
if keyring.is_locked() {
return Ok(Vec::new());
}
The stored attribute hashes are MACs keyed with the keyring key, so a locked keyring can't match attributes at all.
Returning every locked item is not a safe fix
It might look as if SearchItems could return all of the collection's items in locked without matching them. libsecret doesn't search again after unlocking, though. on_lookup_searched in libsecret/secret-methods.c unlocks only locked[0], and on_lookup_unlocked then returns the secret of whatever item that was:
} else if (locked && locked[0]) {
const gchar *paths[] = { locked[0], NULL };
secret_service_unlock_dbus_paths (self, paths, cancellable,
on_lookup_unlocked, ...);
With unmatched candidates in locked, a lookup would hand an application some other item's secret. Fixing this needs a way to match attributes while the keyring is locked.
Impact
- Only reads are affected.
secret-tool storeinto a locked collection prompts and works, because writing needs the collection open. A prompter can therefore look healthy while every lookup fails without a sound. - An application told that no secret exists may decide nothing was ever stored and write a fresh credential over the old one.
- This hits whenever the login collection ends up locked during a session: after a daemon restart, an explicit lock, or a login where no password reaches
pam_oo7(for example a FIDO2 login).
I found this with AI assistance (Claude Opus 5.5) while testing oo7 as a gnome-keyring replacement. The reproduction above was run on the oo7 commit listed under Environment.
- 主要言語
- Rust
- スター
- 481
- フォーク
- 62
- 平均マージ
- 9時間 51分
- マージ済み PR(30日)
- 55
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
linux-credentials/oo7 のほかの issue
-
NoNewPrivileges blocks CAP_IPC_LOCK for oo7-daemon再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンserver
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
linux-credentials/oo7#645 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
server
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
linux-credentials/oo7#685 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
question server
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
linux-credentials/oo7#642 · コメント 8 件 ·
メンテナーはふだん 1 日以内に返信
-
question server
難易度 3/5 半日 初心者へのやさしさ 35/100
linux-credentials/oo7#603 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement server
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
linux-credentials/oo7#593 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
linux-credentials/oo7 の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
pbakaus/impeccable#1620 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
swc-project/swc-next-issues#533 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
nautechsystems/nautilus_trader#5718 ·
メンテナーはふだん 1 日以内に返信
-
`luvus --remote` cannot start on a host whose login shell is Nushell対応中かも @schlich が今日担当しました。 オープンstatus: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 4 日以内に返信