Skip to content

Instantly share code, notes, and snippets.

@Ro1ME
Last active September 26, 2026 04:37
Show Gist options
  • Select an option

  • Save Ro1ME/c383f66d1fd6de40b6693f9b6cc181e7 to your computer and use it in GitHub Desktop.

Select an option

Save Ro1ME/c383f66d1fd6de40b6693f9b6cc181e7 to your computer and use it in GitHub Desktop.
CVE-2026-51856 - Incorrect Access Control in AgentScope (_python.py:execute_python_code)

CVE-2026-51856

Type: Incorrect Access Control Product: AgentScope Affected versions: 1.0.18–1.0.19 Affected component: src/agentscope/agent/_realtime_agent.py:RealtimeAgent._acting, src/agentscope/tool/_toolkit.py:Toolkit.call_tool_function, src/agentscope/tool/_coding/_python.py:execute_python_code Suggested CWE: CWE-284 (Incorrect Access Control) Reference: agentscope-ai/agentscope#1563

Description

In agentscope 1.0.18, 1.0.19, and 1.0.19 when the RealtimeAgent session exposes execute_python_code as an available tool, a remote WebSocket user can prompt the agent to call that tool and run Python code in the service environment. In the validated path, RealtimeAgent._acting forwards the model-produced tool call to Toolkit.call_tool_function, which invokes execute_python_code without an additional approval or isolation boundary on that path.

Reproduction Notes (condensed, sanitized)

Condensed from the authorized local validation used for the original report; local filesystem paths are replaced with <local-path>.

  1. Check out or install agentscope 1.0.19.post1. The same affected source path was also checked in 1.0.18 and 1.0.19.
  2. Prepare a Python environment with the agentscope realtime example dependencies installed. The local validation used the source tree at:
ewproject\Dataset\agentscope 3. Configure an OpenAI-compatible chat-completions endpoint and API key for a model that supports tool calls. Do not hard-code the key in shared artifacts. 4. Start the AgentScope realtime service with the realtime voice agent example and expose the Python execution tool in the session tool list. In the preserved validation, the s 5. Connect a WebSocket client to: ws://127.0.0.1:8010/ws/test-user/ …

Discoverer

Ro1ME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment