T09 · Insecure Skill Coding Practices
- Location
scripts/hardener.py:199- Finding
Workspace-Controlled Shell Script Execution During Security Checks
- Content
View full analysis
List[Finding]: """Run the repo-local security audit (hybrid orchestrator).""" sh = workspace_root / "hybrid_orchestrator" / "scripts" / "audit" / "security_audit.sh" if not sh.exists(): return [Finding("warn", "workspace_audit_missing", "Workspace security_audit.sh not found", str(sh))] try: rc, out, err = run(["bash", str(sh), "--target", str(workspace_root)], timeout_s=900) except Exception as e: return [Finding("fail", "workspace_audit_failed", f"Failed to run workspace audit: {e}")] combined = redact((out + "\n" + err).strip()) sev = "info" if rc == 0 else "warn" return [Finding(sev, "workspace_security_audit", combined)] ``` The function is reached through the default workspace-check path: ```python if args.cmd == "check": do_openclaw = args.all or args.openclaw or (not args.openclaw and not args.workspace and not args.all) do_workspace = args.all or args.workspace or (not args.openclaw and not args.workspace and not args.all) if do_openclaw: findings.extend(check_openclaw_audit(deep=True)) if do_workspace: findings.extend(check_workspace_security_audit(ws)) findings.extend(check_unexpected_exec_bits(ws)) findings.extend(check_dotenv(ws)) findings.extend(check_risky_code_patterns(ws)) ``` ### Technical Analysis The security checker locates `security_audit.sh` inside the workspace being assessed and executes it through `bash`. The existence check does not establish that the script belongs to the trusted skill package, has an approved cryptographic digest, or comes from another trusted source. A repository under attacker control can therefore su ...[truncated 1617 chars]- Remediation
View remediation
