T09 · Insecure Skill Coding Practices
- Location
scripts/generate_image.py:181- Finding
Unrestricted Output Path Allows Arbitrary File Overwrite
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill coherently generates or edits images through Volcengine, but users should treat prompts, input images, filenames, and API keys carefully.
Install only if you are comfortable sending prompts, reference images, and image URLs to Volcengine. Prefer the OpenClaw credential UI or protected environment variables over passing --api-key on the command line, avoid sensitive/private images unless appropriate, and choose output filenames inside a safe working folder because existing writable files can be overwritten.
scripts/generate_image.py:181Unrestricted Output Path Allows Arbitrary File Overwrite
scripts/generate_image.py:139API Key Can Be Exposed Through Command-Line Arguments
scripts/generate_image.py:3Runtime Dependencies Are Not Reproducibly Pinned
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def get_api_key(provided_key: str | None) -> str | None:
"""Get API key from argument first, then environment."""
if provided_key:
return provided_key
return os.environ.get("VOLC_API_KEY") or os.environ.get("ARK_API_KEY")
The skill documents execution of a Python script that uses environment variables, writes output files, and calls an external API, but it does not declare any explicit tool scope such as permissions or allowed-tools. This weakens least-privilege controls and can cause the host agent to grant broader capabilities than users expect, especially for network access and file creation.
The skill supports prompts, local images, multiple reference images, web search, and image URLs, all of which may be transmitted to an external image-generation provider, but the documentation does not warn users about that data flow. Users may unknowingly send sensitive text, private images, or internal URLs to a third-party service, creating confidentiality and privacy risk.
The documentation recommends storing a long-lived API key in persistent configuration and environment variables but does not include credential-handling guidance. This increases the chance of accidental disclosure through checked-in config files, shared home directories, logs, screenshots, or overbroad file permissions, which could enable unauthorized use of the API key.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
body["tools"] = [{"type": "web_search"}]
try:
resp = requests.post(
f"{API_BASE}/images/generations",
headers={
"Content-Type": "application/json",
This markdown file includes setup steps for placing a sensitive credential in environment variables, but it does not warn users that shell history, shared sessions, or process-environment exposure may affect secret safety. Under the markdown-specific warning rule, credential-handling guidance should disclose privacy or security implications when user data or system integrity could be affected.
No suspicious patterns detected.