T09 · Insecure Skill Coding Practices
- Location
scripts/add-model-guide.py:199- Finding
API Keys Are Echoed and Stored Without Enforced Owner-Only Permissions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a local OpenClaw model-configuration helper; its config edits, API key storage, and gateway restart are disclosed and aligned with that purpose, though users should treat the credential handling carefully.
Before installing, understand that this skill can change your OpenClaw model configuration, save provider API keys in plaintext in ~/.openclaw/openclaw.json, and restart the OpenClaw gateway. Use it only on an account where that local config storage is acceptable, set the config file to owner-only permissions, and be cautious about following the optional unpinned npx recommendations for other skills.
scripts/add-model-guide.py:199API Keys Are Echoed and Stored Without Enforced Owner-Only Permissions
README.md:36Documentation Recommends Unpinned Third-Party Package Execution
The Chinese-language description similarly overclaims capabilities such as adding models, natural-language switching, one-click API key configuration, and intelligent model inference that are reportedly not present. Multilingual overstatement broadens the risk by misleading a wider set of users into exposing secrets or relying on nonexistent safeguards during configuration changes.
The Chinese-language description similarly overclaims capabilities such as adding models, natural-language switching, one-click API key configuration, and intelligent model inference that are reportedly not present. Multilingual overstatement broadens the risk by misleading a wider set of users into exposing secrets or relying on nonexistent safeguards during configuration changes.
The Chinese-language description similarly overclaims capabilities such as adding models, natural-language switching, one-click API key configuration, and intelligent model inference that are reportedly not present. Multilingual overstatement broadens the risk by misleading a wider set of users into exposing secrets or relying on nonexistent safeguards during configuration changes.
The Chinese-language description similarly overclaims capabilities such as adding models, natural-language switching, one-click API key configuration, and intelligent model inference that are reportedly not present. Multilingual overstatement broadens the risk by misleading a wider set of users into exposing secrets or relying on nonexistent safeguards during configuration changes.
os.system() and os exec-family calls run shell commands with the process's full privileges, enabling arbitrary command execution.
def restart_gateway():
log_info("重启网关中...")
os.system('openclaw gateway restart > /dev/null 2>&1')
time.sleep(3)
for i in range(10):
result = subprocess.run(['openclaw', 'gateway', 'status'],
The document is predominantly written in Chinese and presents the usage and safety guidance in that language, while only providing an "English Version" self-link rather than an actual alternate-language option. This can violate language/locale policy because the skill documentation effectively forces one language without user opt-in or a documented regional justification.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
The feature description uses natural-language triggers like "use gemini" and "切换到千问" without clarifying whether these are the exact invocation phrases, examples only, or constrained to a specific command interface. Because one example is a short everyday-style phrase in English, the README lacks specificity about trigger scope and exclusion conditions.
The README advertises 'Auto-configure API keys', which implies access to or modification of sensitive credentials. Although the file later says not to provide sensitive information, it does not clearly warn users that the skill may handle API keys or explain the associated privacy and security implications.
The skill documentation describes capabilities that read and write local configuration files and invoke shell commands, but it declares no explicit tool scope such as permissions or allowed-tools. This creates an authorization gap where consumers cannot easily assess or constrain the skill's operational reach before use, increasing the chance of unintended file modification or command execution.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
**API Key 存储方式:**
- **位置:** `~/.openclaw/openclaw.json`
- **格式:** 明文存储(未加密)
- **权限:** 取决于文件权限(建议 `chmod 600`)
**安全建议:**
1. 备份配置文件:`cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak`
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
**API Key 存储方式:**
- **位置:** `~/.openclaw/openclaw.json`
- **格式:** 明文存储(未加密)
- **权限:** 取决于文件权限(建议 `chmod 600`)
**安全建议:**
1. 备份配置文件:`cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak`
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
**API Key 存储方式:**
- **位置:** `~/.openclaw/openclaw.json`
- **格式:** 明文存储(未加密)
- **权限:** 取决于文件权限(建议 `chmod 600`)
**安全建议:**
1. 备份配置文件:`cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak`
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
**API Key 存储方式:**
- **位置:** `~/.openclaw/openclaw.json`
- **格式:** 明文存储(未加密)
- **权限:** 取决于文件权限(建议 `chmod 600`)
**安全建议:**
1. 备份配置文件:`cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak`
The alias "flash" is overly generic and can easily collide with ordinary user language or other model naming conventions, causing the wrong model to be selected. In a skill that performs natural-language model switching, ambiguous aliases directly affect routing behavior and can silently change provider, capabilities, cost, or data-handling characteristics.
Most interactive prompts and status messages are presented only in Chinese, which imposes a specific language on all users. The file does not provide a language selection mechanism or explain that the tool is intentionally limited to a Chinese-speaking context.
The script accepts an API key interactively and writes it into ~/.openclaw/openclaw.json without an explicit warning, consent flow, or permission hardening. Storing long-lived credentials in plaintext on disk increases exposure to local compromise, backups, other tooling, or accidental disclosure, especially in a model-switching skill that is specifically designed to manage provider secrets.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
switch_script = SCRIPT_DIR / "switch-model.py"
if switch_script.exists():
import subprocess
subprocess.run(['python3', str(switch_script), model_key])
else:
print(f"{Colors.YELLOW}⚠️ switch-model.py 不存在,请手动切换{Colors.NC}")
else:
This code presents all user-facing messages in Chinese, including headers, status labels, and descriptions. That forces a specific language for all users without any opt-in, fallback, or documented regional justification, which matches the language/locale policy violation criteria.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
os.system('openclaw gateway restart > /dev/null 2>&1')
time.sleep(3)
for i in range(10):
result = subprocess.run(['openclaw', 'gateway', 'status'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
if 'running' in result.stdout.lower():
log_success("网关已重启完成")
The file includes a link to a Chinese version, which indicates multilingual support exists, but it does not itself force a single language or locale. Because users are given an English README here and can navigate to another language version, this is only a weak signal and likely not a violation.
The user-facing messages at L26, L30, L33, L37-L42, and L44 are written only in Chinese. Per the policy, forcing a specific language without user opt-in or justification is a natural-language policy violation.
The script's status messages, warnings, and usage/help text are presented in Chinese throughout the file. This imposes a specific language on all users without any opt-in, selection mechanism, or documentation that the skill is intentionally limited to a Chinese-speaking context.