T09 · Insecure Skill Coding Practices
- Location
test.sh:39- Finding
Overbroad Wildcard Deletion Can Remove Unrelated User Files
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a coherent xAI image-generation skill with disclosed API use, but users should handle the API key carefully and note that the packaged main executable is missing from the inspected artifact.
Install only if you are comfortable sending prompts and generated-image requests to xAI with your xAI API key. Avoid putting the key in shared dotfiles or synced shell profiles, prefer a per-session export or secret manager, and be aware this reviewed package appears to be missing the documented xai-gen executable.
test.sh:39Overbroad Wildcard Deletion Can Remove Unrelated User Files
requirements.txt:1Non-Reproducible Third-Party Dependency Installation
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
Navigate to skills directory cd ~/.openclaw/workspace/skills
pip3 install requests
chmod +x xai-image-gen/xai-gen
**Set your xAI API key:**
```bash
export XAI_API_KEY="your-api-key-here"
Add to your shell profile (~/.bashrc, ~/.zshrc) to persist:
echo 'export XAI_API_KEY="your-api-key-here"' >> ~/.bashrc
# Generate with simple prompt
xai-gen "sunset over mountains"
# Custom filename
xai-gen "cyberpunk city" --filename city.png
# Generate multiple images
xai-gen "futuristic vehicle" --n 3
# Base64 output (no download)
xai-gen "logo design" --format b64
# Verbose mode
xai-gen "space station" --verbose
positional arguments:
prompt Text description of the image to generate
options:
-h, --help Show help message
--model MODEL Model name
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
## API Details
- Endpoint: https://api.x.ai/v1/images/generations
- Model: grok-imagine-image
- Authentication: Bearer token (XAI_API_KEY)
- Output: JPEG images via URL or base64
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
## API Details
- Endpoint: https://api.x.ai/v1/images/generations
- Model: grok-imagine-image
- Authentication: Bearer token (XAI_API_KEY)
- Output: JPEG images via URL or base64
The instruction to store the API key in ~/.bashrc or ~/.zshrc encourages long-lived credential persistence in shell startup files, which increases the chance of accidental disclosure through backups, dotfile sync, over-broad file permissions, or shell/config sharing. While common, this practice weakens secret hygiene because the token remains available across future sessions and unrelated shell usage.
API Key Error:
export XAI_API_KEY="xai-your-key-here"
# Add to ~/.bashrc or ~/.zshrc for persistence
Permission Error:
The skill clearly sends user prompts and receives generated images from an external xAI service, but the description does not prominently warn users that their content is transmitted off-host. This creates a privacy and data-handling risk because users may submit sensitive prompts or expect purely local processing.
The documented endpoint confirms that this skill transmits user-supplied prompts and authentication data to a third-party API over the network. External transmission is expected for this functionality, but it still represents a real security/privacy concern if users are not clearly informed or if sensitive data is entered.
## API Details
- **Endpoint:** `https://api.x.ai/v1/images/generations`
- **Model:** `grok-imagine-image`
- **Authentication:** Bearer token via `XAI_API_KEY`
- **Rate Limits:** Subject to xAI API limits (check xAI docs)
The dependency is specified as requests>=2.28.0, which allows any future version and does not guarantee reproducible or reviewed installs. This can introduce vulnerable or breaking releases into deployments and makes it difficult to verify exactly which package version is in use.
requests>=2.28.0
The manifest references requests without pinning an exact version, while known advisories exist for some releases of that package. Because the installed version is not fixed, the environment may resolve to a vulnerable release or may change over time, preventing reliable assessment of exposure.
No suspicious patterns detected.