T09 · Insecure Skill Coding Practices
- Location
scripts/cs-free-image-generator-nv.py:15- Finding
Overbroad Shared Credential File Loading with Environment Override
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a straightforward NVIDIA image-generation skill, with disclosed API use and local JSON output, but users should avoid sensitive prompts and review its credential/temp-file handling.
Install only if you are comfortable sending prompts and generated output metadata to NVIDIA and storing full response JSON under /tmp. Keep ~/.openclaw/.env limited to necessary secrets, and prefer a hardened version that reads only NVIDIA_API_KEY and writes output to a private, randomly named file.
scripts/cs-free-image-generator-nv.py:15Overbroad Shared Credential File Loading with Environment Override
scripts/cs-free-image-generator-nv.py:66Predictable Temporary Output Permits Symlink Attacks and Data Exposure
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
"steps": 4,
}
response = requests.post(invoke_url, headers=headers, json=payload, timeout=120)
response.raise_for_status()
response_body = response.json()
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
import requests
# 尝试加载 dotenv(标准方式读取 .env 文件)
try:
import dotenv
dotenv.load_dotenv(os.path.expanduser("~/.openclaw/.env"), override=True)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 尝试加载 dotenv(标准方式读取 .env 文件)
try:
import dotenv
dotenv.load_dotenv(os.path.expanduser("~/.openclaw/.env"), override=True)
except ImportError:
pass
The skill invokes capabilities that access environment variables, write files, and call an external network service, but the manifest does not declare any tool scope or permissions boundary. This weakens reviewability and consent because users and platform controls cannot clearly see that prompts and generated image data will be sent externally and stored locally.
The trigger phrases include very generic requests like '生成图片', '画一张图', and 'text to image', which can match ordinary conversation and cause the skill to activate unexpectedly. Because the skill sends prompts to NVIDIA and saves results locally, accidental activation can expose user content to a third party and create unintended local artifacts.
The markdown does not clearly warn users that their prompts are transmitted to NVIDIA's external service and that the full response, including base64 image data, is saved under /tmp. This creates a transparency and privacy risk because sensitive prompts or generated content may be shared off-device and persist locally without informed user consent.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"steps": 4,
}
response = requests.post(invoke_url, headers=headers, json=payload, timeout=120)
response.raise_for_status()
response_body = response.json()
The module docstring and CLI help text are written in Chinese, which imposes a specific language on users. The file does not offer a language/locale option or indicate that the skill is intentionally limited to a Chinese-speaking context.
The stated purpose is text-to-image generation through NVIDIA's API, but the code also accesses ~/.openclaw/.env to load environment variables. Reading a home-directory configuration file is not mentioned in the manifest and is not inherent from the user-facing description of image generation itself.
The script stores the full API response under /tmp, which may include image URLs, metadata, revised prompts, request identifiers, or other provider-returned content not necessary for the user-facing function. Because /tmp is a shared and less-controlled location on many systems, this creates unnecessary local data exposure and retention beyond the stated skill behavior.