T09 · Insecure Skill Coding Practices
- Location
scripts/generate_image.py:345- Finding
Configuration Inspection Can Expose Nested or Unrecognized Secrets
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This image-generation skill is mostly purpose-aligned, but users should review it because it can upload prompts and images to any configured API endpoint and has weak credential-handling diagnostics.
Install only if you are comfortable sending prompts and any selected images to the configured API provider. Prefer environment variables or a managed OpenClaw secret/config path over a plaintext config.json, avoid putting extra secrets in this skill's config, and do not run --show-config where output may be logged until redaction is improved.
scripts/generate_image.py:345Configuration Inspection Can Expose Nested or Unrecognized Secrets
scripts/generate_image.py:2Runtime Dependencies Are Dynamically Resolved Without Exact Pins or Integrity Locks
The skill allows the caller or local config to select an arbitrary external model provider via base_url and API key, which can redirect prompts and input images to untrusted services. In an image-editing skill that ingests local files, this materially increases exfiltration risk because sensitive visual data may be sent to a malicious or non-compliant endpoint.
Usage:
# Generate new image
uv run generate_image.py --prompt "a cat in space" --output "cat.png" \
--base-url "https://api.example.com" --api-key "your-key" --model "gpt-image-1"
# Edit with single image
uv run generate_image.py --prompt "add a hat" --input dog.png --output "dog_hat.png" \
The skill advertises capabilities that include environment-variable access, file reads, and network use, but it does not declare an explicit tool scope such as permissions or allowed-tools. This weakens policy enforcement and user visibility, increasing the chance that the skill can access secrets or transmit data beyond what a caller expects.
The natural-language instructions and usage guidance for the skill are presented almost entirely in Chinese, while the file does not state that the skill is region-specific or provide an opt-in language choice. This can violate organizational language/locale policy because it forces a specific language for users who may not understand it.
The documentation instructs users to place an API key into a local config.json file inside the skill directory, which is often less protected than environment variables and can be accidentally committed, shared, or read by other local processes. Storing long-lived secrets in plaintext files materially increases credential exposure risk.
# 创建配置文件
cat > {baseDir}/config.json << 'EOF'
{
"baseUrl": "https://api.openai.com/v1",
"apiKey": "your-api-key",
"model": "gpt-image-1"
}
This example reinforces plaintext storage of apiKey in config.json, normalizing an insecure secret-handling pattern. If users follow it, credentials may be exposed through backups, source control, workspace sharing, or unintended file reads by the skill/runtime.
{
"baseUrl": "https://api.openai.com/v1",
"apiKey": "your-api-key",
"model": "gpt-image-1"
}
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
{
"skills": {
"nano-banana-pro": {
"baseUrl": "https://api.example.com/v1",
"apiKey": "your-api-key",
"model": "gpt-image-1"
}
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
{
"skills": {
"nano-banana-pro": {
"baseUrl": "https://api.example.com/v1",
"apiKey": "your-api-key",
"model": "gpt-image-1"
}
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
}
Configuration via skill config.json:
Create ~/.openclaw/skills/nano-banana-pro/config.json:
{
"baseUrl": "https://api.example.com/v1",
"apiKey": "your-api-key",
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
help="Input image path(s) for editing. Can be specified multiple times.",
)
parser.add_argument(
"--base-url", help="API base URL (e.g., https://api.openai.com/v1)"
)
parser.add_argument("--api-key", help="API key")
parser.add_argument("--model", help="Model name (default: gpt-image-1)")
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
help="Input image path(s) for editing. Can be specified multiple times.",
)
parser.add_argument(
"--base-url", help="API base URL (e.g., https://api.openai.com/v1)"
)
parser.add_argument("--api-key", help="API key")
parser.add_argument("--model", help="Model name (default: gpt-image-1)")
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
help="Input image path(s) for editing. Can be specified multiple times.",
)
parser.add_argument(
"--base-url", help="API base URL (e.g., https://api.openai.com/v1)"
)
parser.add_argument("--api-key", help="API key")
parser.add_argument("--model", help="Model name (default: gpt-image-1)")
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
help="Input image path(s) for editing. Can be specified multiple times.",
)
parser.add_argument(
"--base-url", help="API base URL (e.g., https://api.openai.com/v1)"
)
parser.add_argument("--api-key", help="API key")
parser.add_argument("--model", help="Model name (default: gpt-image-1)")
The script sends user prompts and, when provided, local input images to a remote API endpoint without a clear runtime warning or consent prompt. In this skill’s context, users may supply sensitive local images or proprietary prompts, and the configurable base_url means data could be transmitted to arbitrary third-party providers.
No suspicious patterns detected.