T09 · Insecure Skill Coding Practices
- Location
index.js:85- Finding
Caller-Supplied Python Executes on the Host Despite Claimed Sandbox Protection
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a Python execution helper, but it exposes unsandboxed host code execution while presenting sandbox and review behavior that is not actually enforced.
Install only if you are comfortable with the skill running Python code with the same access as the hosting agent. Treat the sandbox label as ineffective in the inspected version, avoid untrusted tasks or code, and use an external container or restricted environment if you need to run it.
index.js:85Caller-Supplied Python Executes on the Host Despite Claimed Sandbox Protection
Model output is used without validation or sanitization. Unvalidated output injected into downstream contexts (SQL, shell, HTML) enables injection attacks and arbitrary code execution.
# In a full implementation:
# 1. Call LLM to understand task and generate Python code
# 2. Execute the generated code with safety checks
# 3. Capture and return results
# Placeholder implementation
Model output is used without validation or sanitization. Unvalidated output injected into downstream contexts (SQL, shell, HTML) enables injection attacks and arbitrary code execution.
# In a full implementation:
# 1. Call LLM to understand task and generate Python code
# 2. Execute the generated code with safety checks
# 3. Capture and return results
# Placeholder implementation
The API documents a sandbox option and logs its value, but executePython always runs python directly via execAsync with no sandboxing or isolation controls. This creates a dangerous false sense of safety: callers may pass untrusted code believing isolation is enforced when in reality the code executes with the host process's filesystem and process privileges.
The skill explicitly describes a workflow that automatically generates and executes Python code, but it does not include any warning, approval boundary, or restriction on filesystem, network, or subprocess actions. In an agent setting, this can normalize unsafe execution of model-generated code and increase the chance of destructive or privacy-impacting actions being performed without informed user consent.
The docstrings and CLI help text state that the skill executes AI-generated Python code, executes Python directly, and reviews code, but the corresponding methods simply log and return canned success messages. This is an intent-code divergence because the documented behavior actively overstates what the code actually does.
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
elif args.python:
# Direct Python execution
result = executor.execute_python(args.task, sandbox=not args.no_sandbox)
else:
# Task mode (default)
executePython writes attacker-controlled Python source to disk and executes it as a subprocess, enabling arbitrary code execution with the permissions of the running service. In the context of an agent skill, this is especially dangerous because the code may access local files, environment secrets, network resources, and modify host state without meaningful safeguards.
The reviewCode docstring says it reviews Python code for security, performance, and style, but the implementation only returns empty issue arrays and a success message without analyzing the input. This is an active contradiction because the code signals a completed review despite performing no review logic.
The natural-language instructions and usage examples are written exclusively in Chinese, and the file does not indicate that this language choice is optional or limited to a region-specific context. Under SQP-3, forcing a specific language without user opt-in can be a policy violation.
The skill returns troubleshooting guidance only in Chinese string literals. This creates a language policy issue because the file does not offer a language choice or document that the skill is intentionally restricted to Chinese-speaking users.