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

オープン
#485 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
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時間
マージ済み PR(30日)
42

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

elastos/elastos-runtime のほかの issue

elastos/elastos-runtime の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。