SearchItems returns no locked items, so libsecret never prompts to unlock
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- authentication, backend
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Rust
- Star
- 481
- Fork
- 62
- Merge trung bình
- 9 giờ 51 phút
- Pull request đã merge (30 ngày)
- 55
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của linux-credentials/oo7
-
NoNewPrivileges blocks CAP_IPC_LOCK for oo7-daemonCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởserver
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
linux-credentials/oo7#645 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
server
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
linux-credentials/oo7#685 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
question server
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
linux-credentials/oo7#642 · 8 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
No D-Bus activation file for org.freedesktop.secrets: outside GNOME nothing starts oo7-daemonĐang mởquestion server
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 35/100
linux-credentials/oo7#603 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement server
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
linux-credentials/oo7#593 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của linux-credentials/oo7
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
pbakaus/impeccable#1620 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
swc-project/swc-next-issues#533 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
nautechsystems/nautilus_trader#5718 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`luvus --remote` cannot start on a host whose login shell is NushellCó thể đã có người làm @schlich đã nhận hôm nay. Đang mởstatus: needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 4 ngày