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

未关闭
#485 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Rust
星标
6
派生
2
平均合并
1 天 3 小时
30 天内合并 PR
42

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

elastos/elastos-runtime 的其他 Issue

查看 elastos/elastos-runtime 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。