T09 · Insecure Skill Coding Practices
- Location
scripts/image_gen.py:156- Finding
Unvalidated Remote Image Downloads and Arbitrary File Overwrite
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This MiniMax image skill is mostly coherent, but it needs Review because its downloader can fetch unvalidated URLs and overwrite arbitrary user-writable files through the output path.
Install only if you are comfortable sending prompts and reference images to MiniMax, storing generated images and prompt summaries locally, and managing the API key yourself. Avoid sensitive images or prompts, prefer base64 mode or a dedicated output directory, and do not let an agent choose arbitrary --output paths for important files.
scripts/image_gen.py:156Unvalidated Remote Image Downloads and Arbitrary File Overwrite
README.md:28Unpinned Package Execution in Installation Instructions
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
)
try:
with urllib.request.urlopen(req, timeout=60) as resp:
result = json.loads(resp.read().decode("utf-8"))
if result.get("base_resp", {}).get("status_code") != 0:
The README instructs users to run npx clawhub install lx-minimax without pinning a specific package version. This creates a supply-chain risk: users may install a newer or compromised release than the author reviewed, and package contents can change over time. In the context of an install command, this is materially relevant because it directly affects what code is fetched and executed on the user's system.
The Chinese installation section repeats the same unpinned npx clawhub install lx-minimax command, carrying the same supply-chain risk. Because installation commands are high-trust copy/paste targets, an unpinned dependency reference increases exposure to malicious or unexpected future package changes.
The skill documentation describes access to sensitive capabilities including an environment variable for an API key, outbound network access to a third-party API, and local file writes, but it does not declare any explicit tool scope or permissions. This is dangerous because consumers and enforcement systems cannot easily constrain or review the skill's required privileges, increasing the risk of over-privileged execution, unintended data exfiltration of prompts/reference images/API keys, or writes outside expected boundaries if the implementation changes or is abused.
The documentation states that the script will automatically download generated images to a local filesystem path, but it does not clearly foreground this side effect, discuss storage/security implications, or describe any user consent/opt-out behavior. In an agent skill context, automatic writes to disk can create privacy, data retention, and workspace contamination risks, especially when handling externally sourced URLs.
The documentation states that the script automatically downloads remote image URLs and writes them to /home/ubuntu/.openclaw/workspace/images/ without clearly foregrounding that local disk writes will occur. In an agent/tool context, silent file creation from external content can surprise users, consume disk space, persist untrusted data, and create downstream risk if other components later process those files.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
from datetime import datetime
API_BASE = "https://api.minimaxi.com/v1/image_generation"
# MiniMax API Key - set MINIMAX_API_KEY environment variable
API_KEY = os.environ.get("MINIMAX_API_KEY", "")
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
from datetime import datetime
API_BASE = "https://api.minimaxi.com/v1/image_generation"
# MiniMax API Key - set MINIMAX_API_KEY environment variable
API_KEY = os.environ.get("MINIMAX_API_KEY", "")
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
from datetime import datetime
API_BASE = "https://api.minimaxi.com/v1/image_generation"
# MiniMax API Key - set MINIMAX_API_KEY environment variable
API_KEY = os.environ.get("MINIMAX_API_KEY", "")
The script hardcodes Chinese-only user-facing log labels and descriptions such as generation type, headers, and explanatory text. This imposes a specific language/locale on outputs without offering the user a choice or documenting a justified locale restriction.
The README includes a dedicated Chinese section with examples and parameter guidance that presumes Chinese-language usage for that portion of the skill documentation. While the file also provides an English section, the skill documentation itself does not state that language selection is optional at runtime or that the skill accepts either locale equally, which can be read as locale-specific guidance without explicit opt-in.
The file's operational instructions and parameter explanations are primarily written in Chinese, which effectively imposes a specific language on users. The document does not indicate that Chinese is intentional for a region-specific audience, nor does it offer an alternative language option or note about locale expectations.
No suspicious patterns detected.