An admin with two passkeys cannot serve shared Exit, Engine or model grants

Đang mở
#485 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
48/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 active_passkey_principals in auth.rs and the four authorization loops in gateway_home_system.rs at lines 3936, 4023, 4069, and 4379. Review the existing Exit test, then add coverage for each grant path with duplicate passkeys and for two different principals holding the same grant ID. Done means duplicate records for one principal are handled once while ambiguity between distinct principals is still refused.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

What happens

An admin can add a second passkey to the same account, for example a security key (#338, #452). After that, Runtime refuses a contact's approved Browser Exit grant from this Home with "Exit grant ownership is ambiguous". The same grant served while the admin had one passkey.

Cause (source reading at 460b1888d)

active_passkey_principals (auth.rs) returns one record per active passkey, and an added passkey keeps the same principal ID and root (complete_passkey_add). authorize_home_service_exit, authorize_home_engine_preparation_cancellation, authorize_home_service_engine and authorize_home_service_model (gateway_home_system.rs 3936, 4023, 4069 and 4379) read the principal's service requests once per record. They find the same grant twice and stop at their ambiguity check, so Engine preparation cancellation is refused as well.

Evidence

A throwaway test at 460b1888d covers Exit only. It passes with one passkey. After a second active passkey record is added for the same principal, it fails with Exit grant ownership is ambiguous. The test builds the second record by hand with the fields the add path writes; it does not run a WebAuthn ceremony. Engine and model use the same loop, so they are expected to fail the same way, but those were not run.

Fix direction

Visit each principal ID once in the four loops and keep the ambiguity check for two different principals. Leave active_passkey_principals unchanged. Add one test per path that adds a second passkey, and keep a test where two different principals hold the same grant ID and are refused.

Release disposition

Milestone 0.8.0. The fix is prepared as its own commit for the same train head as the #483 containment, with its own review. If it is not reviewed and through the gates in time, it becomes a go/no-go item.

Not yet checked

An installed Home with two real passkeys, and whether alpha.24 already includes the add-passkey feature.

Ngôn ngữ chính
Rust
Star
6
Fork
2
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
42

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của elastos/elastos-runtime

Tất cả issue của elastos/elastos-runtime

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.