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

Abierto Apto para principiantes
#3,787 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go
Área
backend, security

Línea de trabajo

Empieza en go/core/internal/service/session/interactions.go en storedSession (L83-94) y el mapeo de interactionError (L713-714); luego lee los sitios de llamada taskSession (L615-630), SendMessage (L456-458) y ListTasks (L637). Reproduce los cuatro pasos del issue contra el controlador A2A para ver las tres respuestas de error distintas. Terminado cuando IDs desconocidos, la sesión de otro usuario y la sesión de otro Agent devuelvan todas TASK_NOT_FOUND, mientras que un llamador que puede leer la sesión pero carece del verbo siga recibiendo un error de permiso.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Go
Estrellas
4.5k
Forks
937
Merge medio
1 d 10 h
PR fusionados (30 d)
150

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de kagent-dev/kagent

Todos los issues de kagent-dev/kagent

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.