T03 · Remote Payload Retrieval and Execution
- Location
engine.py:173- Finding
Externally Generated Python Code Executes Without an Effective Sandbox
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill matches its stated debate-engine purpose, but it exposes high-risk behavior including unsandboxed model-generated code execution, unauthenticated network endpoints, hard-coded credentials, and under-disclosed local data sharing.
Install only after reviewing and fixing the high-risk defaults: remove and rotate the embedded API key, disable generated-code execution or move it to a real isolated sandbox with per-run approval, bind services to localhost with authentication and rate limits, restrict CORS, prevent cross-user broadcasts, and clearly control what local knowledge-base content is stored or sent to external model providers.
engine.py:173Externally Generated Python Code Executes Without an Effective Sandbox
server.py:112Unauthenticated Public Endpoints Can Trigger Model Calls and Code Execution
engine.py:141Local Knowledge-Base Content Is Sent to an External Model Provider
engine.py:37Live API Credential Is Hard-Coded in Source Files
async_engine.py:383Debate Content and Code-Execution Results Are Broadcast Across Users
engine.py:24Writable Workspace Directories Are Given Highest Python Import Precedence
If the actual skill runs HTTP/WebSocket services, exposes broadcast interfaces, and uses permissive CORS while presenting itself mainly as a debate engine, users may unknowingly deploy a reachable network service. Open broadcast endpoints and wide CORS materially increase the chance of data leakage, unauthorized cross-origin access, and abuse of the service from untrusted clients.
If the actual skill runs HTTP/WebSocket services, exposes broadcast interfaces, and uses permissive CORS while presenting itself mainly as a debate engine, users may unknowingly deploy a reachable network service. Open broadcast endpoints and wide CORS materially increase the chance of data leakage, unauthorized cross-origin access, and abuse of the service from untrusted clients.
If the actual skill runs HTTP/WebSocket services, exposes broadcast interfaces, and uses permissive CORS while presenting itself mainly as a debate engine, users may unknowingly deploy a reachable network service. Open broadcast endpoints and wide CORS materially increase the chance of data leakage, unauthorized cross-origin access, and abuse of the service from untrusted clients.
If the actual skill runs HTTP/WebSocket services, exposes broadcast interfaces, and uses permissive CORS while presenting itself mainly as a debate engine, users may unknowingly deploy a reachable network service. Open broadcast endpoints and wide CORS materially increase the chance of data leakage, unauthorized cross-origin access, and abuse of the service from untrusted clients.
The class is labeled '代码沙箱' but actually writes code to a temp file and runs it with the system Python interpreter. This misleading abstraction can cause operators to overtrust the safety of the feature, while the implementation provides none of the isolation expected from a real sandbox.
The skill executes Python code produced by the 'engineer' model as part of normal debate flow, despite the manifest describing a debate/review engine rather than a trusted code runner. This gives externally influenced model output a direct path to code execution, dramatically increasing risk because prompt injection or adversarial topics can steer the model to emit harmful code.
The engine automatically extracts and executes code from model output when enable_code_sandbox is true, without a user-facing warning or confirmation gate. In this skill's context, where the system orchestrates adversarial multi-model interactions, unreviewed execution is especially dangerous because one model can induce another to generate payloads that run locally.
A hardcoded API key is embedded directly in source code. This can lead to credential leakage through source control, logs, backups, or unauthorized reuse, potentially allowing third parties to consume paid API resources or access associated account capabilities.
The class and comments describe 'safe execution', but the implementation simply writes untrusted Python to a temp file and runs it as a normal subprocess. This is especially dangerous because the misleading safety claim can cause operators to trust hostile code paths and enable the feature in production.
The skill's purpose is multi-model debate and design review, yet it adds local execution of model-generated Python, which materially expands the attack surface without being necessary for the core function. In this context, prompt injection or malicious content in debate history can pivot directly into code execution on the host.
The sandbox writes arbitrary generated Python to a temporary file and executes it via subprocess. Although there are internal comments and runtime status prints, there is no explicit warning to the user that untrusted model-produced code may be executed on the system when sandboxing is enabled.
The skill advertises code execution, WebSocket/network behavior, and likely file access capabilities, but it declares no explicit tool scope or permissions. This creates a least-privilege failure: reviewers and users cannot tell what the skill is allowed to do, and a runtime may grant broader access than intended.
The skill description mentions Python sandbox execution and WebSocket pushing but provides no warning about code execution risk or outbound/real-time data transmission. Users may supply sensitive inputs or enable the feature without understanding that generated code may run and that debate content may be transmitted to connected clients.
The execution flow states that conclusions are saved and solidified into a knowledge base, but there is no warning about retention, persistence scope, or what content is stored. In a multi-model debate system, stored conclusions may include user prompts, internal analysis, code, and potentially sensitive business or security information, making silent retention a meaningful privacy and security risk.
A default API key is hardcoded in source, which risks credential leakage through source control, logs, backups, or reuse in other environments. Anyone obtaining the code may be able to abuse the key for unauthorized API usage, incur cost, or access associated account capabilities.
The code invokes subprocess.run on a temporary Python file whose contents come from LLM-generated output. Because the 'sandbox' does not restrict filesystem, network, process creation, or Python imports, this is effectively local execution of untrusted code and can lead to arbitrary code execution, data theft, or host compromise.
temp_path = f.name
try:
result = subprocess.run(
['python3', temp_path],
capture_output=True,
text=True,
The skill sends the user topic and accumulated debate history to an external LLM endpoint, but the code shows no clear disclosure, consent flow, or data minimization controls. This can expose sensitive user inputs, generated code, and internal reasoning context to third-party services, creating privacy and confidentiality risk.
The system prompt explicitly instructs the model to reply in Chinese, imposing a language choice regardless of user preference. This is a natural-language policy issue because no opt-in or user-selectable locale is offered.
The code launches Python on model-generated content via subprocess.run without any real sandboxing beyond a timeout and /tmp working directory. An attacker who can influence the model output or debate topic can cause arbitrary local code execution, including file access, network calls, or process spawning with the privileges of the running service.
temp_path = f.name
try:
result = subprocess.run(
['python3', temp_path],
capture_output=True,
text=True,
This function sends system and user prompts to a remote LLM endpoint over HTTP, which may transmit user-provided topics and generated content off-box. The code does not provide a clear user warning or documentation disclosure that debate inputs are sent to an external service.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}
try:
resp = requests.post(BASE_URL, headers=headers, json=payload, timeout=90)
if resp.status_code != 200:
release_api_key(model, rate_limit_hit=(resp.status_code == 429))
The system prompt explicitly instructs the models to always reply in Chinese. This is a language policy constraint imposed by the skill without offering the user a language choice or documenting a justified locale restriction.
The file-level description, authoring text, and subsequent user-facing strings are all written exclusively in Chinese, indicating the skill is designed to communicate in a single language. The policy requires either user opt-in for a forced language/locale or a clearly documented justification for the restriction, which is not present here.
The file exposes a network-accessible FastAPI server bound to 0.0.0.0 with permissive CORS, open HTTP routes, and an unauthenticated WebSocket endpoint that can trigger background debate tasks. In the context of a local skill, this materially expands the attack surface beyond a narrowly scoped internal helper and could allow any reachable client to invoke compute-intensive operations or interact with connected clients.
模块头部 L004 宣称集成“WebSocket”,但代码中仅有全局 ws_clients 列表和一个 broadcast_ws 方法(L442-L449),没有连接建立、认证、注册、生命周期管理或服务端入口。该实现与描述的集成能力相比明显更弱,更像未完成的辅助接口。