Skip to content

fix(server-common): enforce read authorization on referenced task lookup - #1005

Open
ehsavoie wants to merge 1 commit into
a2aproject:mainfrom
ehsavoie:reference_tasks
Open

fix(server-common): enforce read authorization on referenced task lookup#1005
ehsavoie wants to merge 1 commit into
a2aproject:mainfrom
ehsavoie:reference_tasks

Conversation

@ehsavoie

@ehsavoie ehsavoie commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Filter referenced tasks (referenceTaskIds) through TaskAuthorizationProvider before populating the RequestContext, so callers cannot read tasks they are not authorized to access.

Pass ServerCallContext to validateRequestedTask so the authorization decorator can check read permissions when streaming or subscribe requests reference an existing task. Without this, an unauthorized caller could probe for task existence via sendStreamingMessage or subscribeToTask.

  • Expose getServerCallContext() on RequestContext.Builder
  • Wire TaskAuthorizationProvider into SimpleRequestContextBuilder
  • Inject TaskAuthorizationProvider via CDI in DefaultRequestHandler
  • Propagate ServerCallContext through validateRequestedTask in all transports (JSON-RPC, REST) and decorators (OTel, auth)
  • Standardize fail-closed authorization in InMemoryTaskStore to match JpaDatabaseTaskStore (deny when auth is configured but no context)
  • Add unit and integration tests for reference task authorization

@ehsavoie
ehsavoie requested review from jmesnil and kabir August 3, 2026 10:25
- Authorize referenceTaskIds through TaskAuthorizationProvider before
  populating RequestContext; fail with TaskNotFoundError on denial
- Rename validateRequestedTask → authorizeTaskAccess, passing
  ServerCallContext for auth checks in streaming/subscribe paths
- Replace DefaultRequestHandler.create() with Builder pattern
- Make populate-referred-tasks configurable (a2a.request-context)
- Standardize fail-closed authorization in both TaskStore impls

Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant