Back to skill

Security audit

Tophant Clawvault Openclaw Alerts

Security checks for vulnerabilities and agentic risk

Overview

This alerting skill is coherent, but it needs review because it can run a background daemon, contact configurable HTTP(S) endpoints, and pass untrusted security-event text into an OpenClaw agent.

Review this before installing in sensitive environments. Use a dedicated low-privilege OpenClaw notification agent, keep external `--deliver` routes limited to trusted channels, leave input previews and file paths disabled unless necessary, and keep the dashboard URL on loopback unless you explicitly trust the remote source and its event data.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T01 · Skill Instruction Hijacking

Error
Location
clawvault_openclaw_alerts.py:356
Finding

Untrusted Dashboard Event Data Is Forwarded to an AI Agent Without Instruction Isolation

Content
View full analysis
str: alerts = self.cfg["alerts"] lines = [ "ClawVault 高危安全事件", "", f"级别:{str(event.get('threat_level') or event.get('severity') or 'unknown').upper()}", f"来源:{event.get('source', 'unknown')}", f"动作:{event.get('action') or event.get('action_taken') or 'unknown'}", f"风险分:{self._risk(event):.1f}", f"检测数:{event.get('total_detections', self._detection_count(event))}", f"Agent:{event.get('agent_id') or event.get('agent_name') or 'unknown'}", f"Session:{self._short_session(event.get('session_id'))}", f"时间:{event.get('timestamp') or event.get('ts') or 'unknown'}", ] if alerts.get("include_file_path") and event.get("file_path"): lines.append(f"文件:{self.redact(str(event['file_path']))}") if alerts.get("include_input_preview") and event.get("input_preview"): lines.extend(["", "摘要:", self.redact(str(event["input_preview"]))]) lines.extend(["", "说明:通知已脱敏。请打开 ClawVault Dashboard 查看完整详情。"]) return self.redact("\n".join(lines))[: int(alerts.get("max_message_chars", 1200))] ``` ```python def send_message(self, message: str) -> dict[str, Any]: oc = self.cfg["openclaw"] cmd = [ str(oc.get("command", "openclaw")), "agent", "--agent", str(oc.get("agent_id", "main")), "--session-id", str(oc.get("session_id", "clawvault-alerts")), "--message", message, "--json", ] if oc.get("local", True): cmd.insert(2, "--local") if oc.get("channel"): cmd.extend(["--channel", str(oc["channel"])]) if oc.get("deliver ...[truncated 3534 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
clawvault_openclaw_alerts.py:130
Finding

Configurable Dashboard URL Allows Requests to Arbitrary HTTP(S) Destinations

Content
View full analysis
dict[str, Any]: cfg = self.load() if self.path.exists() else default_config() if args.dashboard_url: cfg["dashboard"]["base_url"] = args.dashboard_url ``` ```python def validate(self, cfg: dict[str, Any]) -> list[str]: errors: list[str] = [] base_url = str(cfg.get("dashboard", {}).get("base_url", "")) parsed = urllib.parse.urlparse(base_url) if parsed.scheme not in {"http", "https"} or not parsed.netloc: errors.append("dashboard.base_url must be an http(s) URL") ``` ```python def _get_json(self, path: str) -> Any: url = self.base_url + path req = urllib.request.Request(url, headers={"Accept": "application/json"}) try: with urllib.request.urlopen(req, timeout=self.timeout) as resp: if resp.status >= 400: raise RuntimeError(f"dashboard returned HTTP {resp.status}: {path}") return json.loads(resp.read().decode("utf-8")) except urllib.error.URLError as exc: raise RuntimeError(f"dashboard request failed: {exc}") from exc ``` ### Technical Analysis The declared network purpose is to read a local ClawVault dashboard, whose default address is `http://127.0.0.1:8766`. Validation, however, accepts any syntactically valid HTTP or HTTPS URL with a network location. It does not restrict the host to loopback, enforce an approved-host list, reject link-local or cloud metadata addresses, require HTTPS for remote endpoints, or validate redirect destinations. Once configured, commands such as `status`, `run-once`, `daily-report`, and the persistent monitoring daemon issue requests to the selected host. ...[truncated 1818 chars]
Remediation
View remediation
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (9)

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · skill.json (reported line 4)May include surrounding context.

json
{
  "name": "tophant-clawvault-openclaw-alerts",
  "version": "0.1.0",
  "description": "Push high-risk ClawVault security events and daily security reports through OpenClaw agent messaging.",
  "author": "Tophant SPAI Lab",
  "homepage": "https://github.com/tophant-ai/ClawVault",
  "repository": "https://github.com/tophant-ai/ClawVault",
  "main": "clawvault_openclaw_alerts.py",
  "permissions": ["execute_command", "write_files", "read_files", "network"],
  "permissions_rationale": {
    "execute_command": "Required to invoke openclaw agent messaging and manage the background alert daemon",
    "write_files": "Stores alert configuration, PID, deduplication state,

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill advertises user-invocable behavior and references capabilities that include file reads/writes, network access, and shelling out via openclaw agent, but it does not declare any explicit tool scope or permissions boundary in the manifest. That omission weakens reviewability and least-privilege enforcement, making it easier for the runtime or a user to invoke broader capabilities than are necessary for an alerting workflow.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

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.

Content

Scanner excerpt · SKILL.md (reported line 51)May include surrounding context.

/tophant-clawvault-openclaw-alerts configure

Create or update ~/.ClawVault/openclaw-alerts/config.yaml.

bash
/tophant-clawvault-openclaw-alerts configure --agent main --session-id clawvault-alerts

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The event summary strings are hard-coded in Chinese, which imposes a specific language on users regardless of their locale or preference. The policy explicitly forbids forcing a language without user opt-in or documented justification.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
82% confidence
Finding

The code executes an external command taken from configuration via openclaw.command. Although shell=True is not used, a user-controlled executable name/path can cause execution of an unintended program if the config is tampered with or PATH resolution is abused, which is meaningful in an agent skill that automatically sends security alerts.

Content

Scanner excerpt · clawvault_openclaw_alerts.py (reported line 444)May include surrounding context.

python
cmd.extend(["--reply-to", str(oc["reply_to"])])
        try:
            timeout = int(oc.get("timeout_seconds", 180))
            run = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
            timed_out = False
            error = None
        except subprocess.TimeoutExpired as exc:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The daily report content is fully hard-coded in Chinese and does not offer any language choice. This is a natural-language locale policy issue because the skill dictates a language rather than letting the user opt in or documenting a justified regional constraint.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · clawvault_openclaw_alerts.py (reported line 636)May include surrounding context.

python
log_file.parent.mkdir(parents=True, exist_ok=True)
        log = open(log_file, "a", encoding="utf-8")
        cmd = [sys.executable, __file__, "start", "--foreground", "--config", str(self.config_path)]
        process = subprocess.Popen(cmd, stdout=log, stderr=log, start_new_session=True)
        pid_file.parent.mkdir(parents=True, exist_ok=True)
        pid_file.write_text(str(process.pid), encoding="utf-8")
        return {"success": True, "pid": process.pid, "log_file": str(log_file)}

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This code performs safety-relevant operations by writing a PID file, opening a log file, and spawning a long-running background subprocess. In this section there is no confirmation prompt, print/log disclosure, or explanatory comment warning the user that a daemon will be launched and files will be created under the configured paths.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The non-JSON CLI output uses hard-coded Chinese text such as 'OK' context labels elsewhere and may present localized behavior inconsistently, but more importantly the broader skill output path does not provide locale selection for human-readable responses. This continues the pattern of forced language without user opt-in.

Content

No source excerpt is available for this finding.