Cross-invocation code-execution capability bleed via shared LlmAgent mutation
メンテナーはふだん 1 日以内に返信
@surajksharma07 がすでに取り組んでいます。
2026年9月21日 から。
評価
この issue はまだ評価されていません。
説明
Summary
Before commit f8282dafd3bc63476b76af31d1df3abdad6370fa, an invocation-scoped CFC setting could permanently mutate a shared LlmAgent instance.
When one invocation used RunConfig(support_cfc=True), Runner._new_invocation_context() assigned:
cfc_agent.code_executor = BuiltInCodeExecutor()
If the same long-lived Runner / Agent instance was then reused for another session or request with support_cfc=False, the later invocation could still receive the built-in code_execution capability.
This is a cross-invocation capability/policy bleed: a capability enabled for one invocation persisted into a different invocation that explicitly did not request it.
Affected version
- Reproduced on the direct parent of the fix:
43b73e4f - The released
v2.9.1source contains the vulnerable assignment insrc/google/adk/runners.py - Fix: https://github.com/google/adk-python/commit/f8282dafd3bc63476b76af31d1df3abdad6370fa
Minimal reproduction
The reproduction only needs local ADK objects; no Gemini call, Google API, or external service is required.
- Create one
Agentwithcode_executor=None. - Create one
InMemoryRunnerusing that Agent. - Create independent session A and session B.
- Build invocation A with
RunConfig(support_cfc=True). - Run the code-execution request processor for A.
- Build invocation B with
RunConfig(support_cfc=False)using the same Agent. - Run the same request processor for B.
Expected
Invocation B should not receive BuiltInCodeExecutor, because CFC is disabled for B.
Pre-fix behavior
Invocation B still sees the built-in code-execution capability because invocation A mutated persistent shared Agent state.
Root cause
RunConfig.support_cfc is invocation-scoped, while LlmAgent.code_executor is persistent shared object state.
The pre-fix Runner converted an invocation-scoped decision into a permanent mutation of the shared Agent. Later invocations therefore observed a capability they did not request.
Security / isolation impact
This is a capability-isolation failure, not a claim of code execution on the ADK host itself.
The issue is that a request/session configured without the CFC / built-in code-execution capability can receive that capability because a previous invocation using the same shared Agent enabled it.
This matters for long-lived shared Runner/Agent instances, especially where different sessions, users, or policy contexts use different per-invocation capabilities.
Fixed behavior
Commit f8282dafd3bc63476b76af31d1df3abdad6370fa removes the in-place mutation of Runner.agent and resolves BuiltInCodeExecutor dynamically per invocation in _code_execution.py.
Opening this issue for public tracking/documentation of the affected released behavior and the fix.
- 主要言語
- Python
- スター
- 21.6k
- フォーク
- 4k
- 平均マージ
- 6時間 56分
- マージ済み PR(30日)
- 7
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
google/adk-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
google/adk-python#7292 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
google/adk-python#7289 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
google/adk-python#7282 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
core needs review
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
google/adk-python#7266 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
mcp
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
google/adk-python#7265 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
google/adk-python の issue をすべて見る
似ている issue
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
vllm-project/vllm-metal#822 ·
メンテナーはふだん 1 日以内に返信
-
vector-store
難易度 1/5 1〜3時間 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: chunk_span_bounds and _validated_chunk_spans reject Pydantic models ChunkSpan and AudioFileオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
BasedHardware/omi#19047 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信