T09 · Insecure Skill Coding Practices
Error
- Location
- clawhub_guard.py:54
- Finding
- Bypassable Vetting Allows Untrusted Marketplace Skills to Be Installed as Low Risk<![CDATA[ ## Vulnerability Details **File Location**: `clawhub_guard.py:54-94` and `clawhub_guard.py:171-193` **Vulnerability Type**: Weak, bypassable security validation before third-party skill installation **Risk Level**: High ### Vulnerable Code ```python def quick_vet(slug, description=""): """Quick risk assessment based on name and description.""" risk = "LOW" flags = [] desc_lower = description.lower() slug_lower = slug.lower() # Red flag patterns high_risk_keywords = [ "credential", "password", "token", "secret", "sudo", "root", "wallet", "trade", "exchange", "transfer", "payment", "auth", "login", "ssh", "key", ] medium_risk_keywords = [ "upload", "download", "fetch", "curl", "wget", "browser", "execute", "shell", "command", ] for kw in high_risk_keywords: if kw in slug_lower or kw in desc_lower: risk = "HIGH" flags.append(f"HIGH: contains '{kw}'") break if risk != "HIGH": for kw in medium_risk_keywords: if kw in slug_lower or kw in desc_lower: risk = "MEDIUM" flags.append(f"MEDIUM: contains '{kw}'") break # Known safe patterns safe_patterns = ["skill-vetter", "codegraph", "openclaw", "hermes", "cursor"] for sp in safe_patterns: if sp in slug_lower: risk = "LOW" flags = [] break return {"risk": risk, "flags": flags} ``` ```python def cmd_install(slug): print(f"Vetting {slug} before install...") out, err, rc = run_ch(["inspect", slug], timeout=30) vet = quick_vet(slug, out[:200]) risk_icon = {"LOW": "🟢", "MEDIUM": "🟡", "HIGH": "🔴"}.get(vet["risk"], "⚪") print(f" Risk: {risk_icon} {vet['risk']}") if vet["risk"] == "HIGH": print(f" ⚠ High risk skill — manual review recommended before install.") print(f" Run: clawhub install {slug} --for ...[truncated 2904 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove all substring-based trust overrides. A package must never be considered safe solely because its slug contains a recognized project name. 2. Integrate the actual `skill-vetter` review promised by the documentation and fail closed if that review is unavailable, incomplete, times out, or returns an error. 3. Retrieve and inspect the complete package contents rather than the first 200 characters of descriptive output. 4. Validate exact package and publisher identities using a maintained allowlist where appropriate; do not use partial-name matching. 5. Verify package signatures, checksums, provenance, and immutable version identifiers before installation when supported by the marketplace. 6. Check `rc`, `err`, and the completeness of inspection output. Abort installation on any nonzero return code, malformed response, or missing security result. 7. Require explicit user confirmation after displaying the complete review findings instead of automatically passing `-y`. 8. Treat unknown or inconclusive results as blocked or HIGH risk rather than defaulting to LOW. 9. Run installation and subsequent review in a sandbox with minimal filesystem, credential, tool, and network access. 10. Update `SKILL.md` so its security claims accurately match the implemented behavior until genuine `skill-vetter` integration is present. ]]>
