T09 · Insecure Skill Coding Practices
- Location
scripts/skill_manage.py:246- Finding
Heuristic Residual Cleanup Can Delete Unrelated Files Outside the Selected Skill
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a real OpenClaw skill manager, but its uninstall cleanup can remove files beyond the selected skill and can delete config files even when the prompt says they are preserved.
Review this before installing. Use --dry-run first, avoid --force, back up skill config files, and verify every path the uninstall command plans to remove. The cleanup logic should be narrowed to recorded skill-owned paths before it is trusted for routine use.
scripts/skill_manage.py:246Heuristic Residual Cleanup Can Delete Unrelated Files Outside the Selected Skill
scripts/skill_manage.py:226Uninstall Reconnaissance Reads Complete Global Configuration Files
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
`uninstall` 命令在删除主目录前会先**扫描残留痕迹**,包括:
- ✅ SkillHub 锁文件记录(从 `skillhub.lock.json` 移除)
- ✅ 配置文件(config.json / .env / .yaml)
- ✅ 缓存目录(cache/、TMP/、__pycache__/)
- ✅ workspace 中的残留文件
- ✅ OpenClaw 主配置引用
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
`uninstall` 命令在删除主目录前会先**扫描残留痕迹**,包括:
- ✅ SkillHub 锁文件记录(从 `skillhub.lock.json` 移除)
- ✅ 配置文件(config.json / .env / .yaml)
- ✅ 缓存目录(cache/、TMP/、__pycache__/)
- ✅ workspace 中的残留文件
- ✅ OpenClaw 主配置引用
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
residuals["has_credentials"] = True
residuals["config_files"].append(str(config_file))
# 扫描主目录下的所有 .json / .env / .yaml 文件
for pattern in ["*.json", "*.env", "*.yaml", "*.yml", "*.ini", "*.cfg"]:
for f in skill_path.rglob(pattern):
if f.is_file():
residuals["config_files"].append(str(f))
The trigger phrase "帮我管理 Skill" is broad, conversational language that can overlap with normal help-seeking requests rather than a narrowly scoped command. In a system-management skill that can update or uninstall installed skills, overly broad activation increases the chance of accidental invocation and unintended administrative actions.
This code file contains multiple natural-language strings that force Chinese for key user interactions, including the module description and later command prompts/help. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly justified.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
if meta["source"] == "GitHub":
print(f"[GitHub] {meta['name']} -> git pull")
try:
r = subprocess.run(
["git", "pull"],
cwd=str(skill_path),
capture_output=True,
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
slug_arg = meta["name"].lower().replace(" ", "-")
print(f"[SkillHub] {meta['name']} -> skillhub install {slug_arg}")
try:
r = subprocess.run(
["skillhub", "install", slug_arg],
capture_output=True,
text=True,
This markdown file includes section headings and entries in Chinese while earlier content is in English, but it does not explain whether the skill is intentionally bilingual or scoped to Chinese-speaking users. Under the language/locale policy rule, forcing or assuming a language without opt-in can be a policy concern.