[BUG] A2A lookups by task or context ID reveal whether another user's resource exists

オープン 初心者向け
#3,787 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
backend, security

調査の方向性

go/core/internal/service/session/interactions.go の storedSession (L83-94) と interactionError のマッピング (L713-714) から開始し、次に呼び出し箇所 taskSession (L615-630)、SendMessage (L456-458)、ListTasks (L637) を読む。issue の4つの手順を A2A コントローラーに対して再現し、3つの異なるエラー応答を確認する。完了条件は、未知の ID、別のユーザーのセッション、別の Agent のセッションがすべて TASK_NOT_FOUND を返し、一方、セッションを読めるが verb を持たない呼び出し元には依然として権限エラーが返ること。

索引モデルが issue の本文から書いたものです。

説明

📋 Prerequisites
  • I have searched the existing issues to avoid creating a duplicate
  • By submitting this issue, you agree to follow our Code of Conduct
  • I am using the latest version of the software (checked against main at e8cd153)
  • I have tried to clear cache/cookies or used incognito mode (if ui-related)
  • I can consistently reproduce this issue
🎯 Affected Service(s)

Controller (A2A gateway)

🚦 Impact/Severity

Minor

🐛 Bug Description

The A2A gateway tells a caller whether a task or context it may not read exists. A2A 1.0.1 §3.3.2 says servers MUST NOT reveal the existence of resources the client is not authorized to access. IDs are random, so the impact is low, but the MUST is not met.

Every lookup goes through storedSession (interactions.go L83-94), which answers in three different ways:

  • unknown ID: TASK_NOT_FOUND
  • another user's session: a permission error, since interactionError maps CodePermissionDenied to ErrUnauthorized (L713-714)
  • a session that belongs to a different Agent: ErrUnauthorized with "context does not belong to this Agent" (L91-92)

This affects GetTask, CancelTask and SubscribeToTask through taskSession (L615-630), and also SendMessage with a taskId or contextId (L456-458) and ListTasks with a contextId (L637).

🔄 Steps To Reproduce
  1. User A sends a message to Agent X and notes the returned task ID and context ID.
  2. User B calls GetTask on Agent X with A's task ID, then with a random ID.
  3. User B calls ListTasks on Agent X with A's context ID, then with a random one.
  4. User A calls GetTask on Agent Y with their own task ID.
🤔 Expected Behavior

Every call returns TASK_NOT_FOUND.

📱 Actual Behavior

Steps 2 and 3 return a permission error for A's IDs and TASK_NOT_FOUND for random ones. Step 4 returns "context does not belong to this Agent".

🔍 Additional Context

The fix belongs in storedSession: answer not-found when the caller cannot read the session, or when it belongs to another Agent. A caller who can read a session but lacks the verb for the operation (for example, a read-only share user who sends a message) may still get a permission error, since they already know it exists.

主要言語
Go
スター
4.5k
フォーク
937
平均マージ
1日 10時間
マージ済み PR(30日)
150

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

kagent-dev/kagent のほかの issue

kagent-dev/kagent の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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