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

Aperta Adatta ai principianti
#3,787 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
backend, security

Direzione di ricerca

Inizia in go/core/internal/service/session/interactions.go a storedSession (L83-94) e alla mappatura interactionError (L713-714); poi leggi i punti di chiamata taskSession (L615-630), SendMessage (L456-458) e ListTasks (L637). Riproduci i quattro passaggi dell’issue contro il controller A2A per vedere le tre distinte risposte di errore. Fatto quando ID sconosciuti, la sessione di un altro utente e la sessione di un altro Agent restituiscono tutti TASK_NOT_FOUND, mentre un chiamante che può leggere la sessione ma non ha il verbo riceve comunque un errore di permesso.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

📋 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.

Lingua principale
Go
Stelle
4.5k
Fork
937
Merge medio
1g 10h
PR unite (30g)
150

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di kagent-dev/kagent

Tutte le issue di kagent-dev/kagent

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.