Skip to content

fix: do not use A2A context_id as ADK user#534

Merged
ishymko merged 1 commit into
mainfrom
ishymko/context-id-user-id
Apr 24, 2026
Merged

fix: do not use A2A context_id as ADK user#534
ishymko merged 1 commit into
mainfrom
ishymko/context-id-user-id

Conversation

@ishymko
Copy link
Copy Markdown
Member

@ishymko ishymko commented Apr 24, 2026

The A2A context_id must never be used as the ADK user_id: it is client-supplied and a malicious caller that learns another user's context_id could otherwise hijack their ADK session state.

The A2A `context_id` must never be used as the ADK `user_id`: it is client-supplied and a malicious caller that learns another user's     `context_id` could otherwise hijack their ADK session state.
@ishymko ishymko changed the title fix: do not use context_id as ADK user fix: do not use A2A context_id as ADK user Apr 24, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances security by resolving a stable user_id from the request context instead of relying on the client-supplied context_id for session management. These changes are implemented across both the adk_currency_agent and adk_skills_agent. Feedback was provided regarding the duplication of the ensure_session method and _resolve_user_id function, suggesting they be refactored into a shared utility or base class to adhere to DRY principles.

@ishymko ishymko merged commit 7f05d56 into main Apr 24, 2026
9 checks passed
@ishymko ishymko deleted the ishymko/context-id-user-id branch April 24, 2026 08:14
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.

2 participants