Cross-invocation code-execution capability bleed via shared LlmAgent mutation
@surajksharma07 đang làm issue này rồi.
Từ ngày 21/9/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 21.6k
- Fork
- 4k
- Merge trung bình
- 13 giờ 49 phút
- Pull request đã merge (30 ngày)
- 10
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của google/adk-python
-
mcp
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
google/adk-python#7217 · 3 bình luận · 1 người được giao ·
-
tools
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
google/adk-python#7206 · 1 bình luận · 1 người được giao ·
-
request clarification tools
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
google/adk-python#7205 · 2 bình luận · 1 người được giao ·
-
mcp
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
google/adk-python#7196 · 1 bình luận · 1 người được giao ·
-
eval request clarification
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 86/100
google/adk-python#7146 · 2 bình luận · 1 người được giao ·
Tất cả issue của google/adk-python
Issue tương tự
-
essnmx good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
[Feature] 奇物选择添加优先级 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
syfoud/Simulated_Scepter#174 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Giskard-AI/giskard-oss#2840 · 1 bình luận ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Đang mởarea: repo bug perceived difficulty: 2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
yeti-platform/yeti#1380 ·