Back to skill

Security audit

OpenClaw OA Operator

Security checks for vulnerabilities and agentic risk

Overview

This OA operator skill is command-oriented, but the artifacts match its stated OA monitoring purpose and do not show hidden exfiltration, persistence, or destructive behavior.

Install this only for OA-enabled OpenClaw workspaces where local command execution and workspace inspection are acceptable. Review self-heal command templates before letting an agent run them, and harden the smoke-test script's temporary log handling before using it in shared or privileged environments.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/oa_workspace_smoke_test.sh:27
Finding
Predictable Temporary Log File Enables Local File Clobbering and Information Disclosure## Vulnerability Details **File Location**: `scripts/oa_workspace_smoke_test.sh`, lines 27–30 and 34 **Vulnerability Type**: Predictable unsafe temporary file **Risk Level**: Medium ### Vulnerable Code ```bash oa collect -c "$CONFIG_PATH" >/tmp/oa-skill-smoke-collect.log 2>&1 || { cat /tmp/oa-skill-smoke-collect.log >&2 fail "oa collect failed" } ok "oa collect succeeded" HEALTH_BODY="$(mktemp)" GOALS_BODY="$(mktemp)" TEAM_BODY="$(mktemp)" trap 'rm -f "$HEALTH_BODY" "$GOALS_BODY" "$TEAM_BODY" /tmp/oa-skill-smoke-collect.log' EXIT ``` ### Technical Analysis The script redirects command output to the fixed, publicly predictable path `/tmp/oa-skill-smoke-collect.log`. Unlike the response-body files created with `mktemp`, this log is not created atomically with a unique name. An attacker with local access to the same temporary directory can create that pathname before the script runs. If the path is a symbolic link and the operating system's link protections and filesystem permissions permit following it, shell redirection may open and truncate the link target. Concurrent script executions can also overwrite or delete one another's logs. The output permissions depend on the invoking process's `umask`. Consequently, diagnostic output from `oa collect`—potentially including configuration errors, workspace paths, agent identifiers, or other operational details—could become readable by other local users. The script also prints the log to standard error on failure, but that behavior is expected; the vulnerability is the unsafe creation and storage of the log in a shared temporary directory. ### Attack Path 1. The attacker has local access sufficient to create files or symbolic links under `/tmp`. 2. Before a privileged or more trusted user starts the smoke test, the attacker creates `/tmp/oa-skill-smoke-collect.log`. 3. The attacker either: - links the path to a file writable by the victim process, or - creates a normal file and monitors it for diagno ...[truncated 1418 chars]
Remediation
## Remediation Suggestions Create every temporary file atomically with `mktemp`, apply restrictive permissions, and install the cleanup trap immediately after creation. For example: ```bash COLLECT_LOG="$(mktemp "${TMPDIR:-/tmp}/oa-skill-smoke-collect.XXXXXX")" HEALTH_BODY="$(mktemp "${TMPDIR:-/tmp}/oa-skill-health.XXXXXX")" GOALS_BODY="$(mktemp "${TMPDIR:-/tmp}/oa-skill-goals.XXXXXX")" TEAM_BODY="$(mktemp "${TMPDIR:-/tmp}/oa-skill-team.XXXXXX")" chmod 600 "$COLLECT_LOG" "$HEALTH_BODY" "$GOALS_BODY" "$TEAM_BODY" trap 'rm -f -- "$COLLECT_LOG" "$HEALTH_BODY" "$GOALS_BODY" "$TEAM_BODY"' EXIT if ! oa collect -c "$CONFIG_PATH" >"$COLLECT_LOG" 2>&1; then cat -- "$COLLECT_LOG" >&2 fail "oa collect failed" fi ``` Additional hardening measures: 1. Set `umask 077` near the beginning of the script so newly created diagnostic files are private by default. 2. Avoid fixed names anywhere in a shared temporary directory. 3. Quote all cleanup paths and use `rm -f --` to terminate option processing. 4. Register cleanup as soon as temporary files are created so early failures do not leave diagnostics behind. 5. Consider creating one private temporary directory with `mktemp -d`, storing all artifacts inside it, and removing that directory on exit. 6. Avoid running the smoke test with elevated privileges unless the OA workspace explicitly requires them.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (3)

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill repeatedly instructs the agent to run local operational commands and shell scripts such as `oa collect`, `oa serve`, and `scripts/oa_workspace_smoke_test.sh`, but it does not declare any explicit tool scope or permission boundary. That creates a real least-privilege problem: an agent may invoke shell access more broadly than intended during troubleshooting or packaging tasks, increasing the chance of unsafe command execution in a sensitive local workspace.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The invocation description is broad enough to match common setup, repair, monitoring, dashboard, and release-preparation requests across an OpenClaw workspace. That over-breadth can cause the skill to trigger in routine troubleshooting contexts and then steer the agent into shell-backed operational workflows, configuration changes, or self-heal actions beyond what the user specifically intended.

External Transmission

Medium
Category
Data Exfiltration
Content
}

need_cmd oa
need_cmd curl

[ -d "$PROJECT_DIR" ] || fail "Project directory not found: $PROJECT_DIR"
[ -f "$CONFIG_PATH" ] || fail "config.yaml not found under: $PROJECT_DIR"
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Static analysis

No suspicious patterns detected.