Back to skill

Security audit

Multi-Agent Deployment Skill for OpenClaw

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does what it says, but its deployment and memory-sync scripts can make broad persistent changes with weak safety controls.

Review and harden deploy.sh before use, avoid root SSH where possible, use a dedicated deployment account, and do not run memory_sync.py automatically unless you trust every agent workspace being synchronized. Back up MEMORY.md files first and treat Cross-Agent Intel as untrusted reference data, not instructions.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • 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)

T09 · Insecure Skill Coding Practices

Error
Location
deploy.sh:14
Finding

Remote Command and SSH Option Injection Through Unsanitized Deployment Arguments

Content
View full analysis
Remediation
View remediation
&2 exit 1 fi ``` 2. **Use Bash arrays instead of command strings** ```bash SSH=(ssh -i "$KEY" -- "$VPS") SCP=(scp -i "$KEY" --) ``` Invoke them with: ```bash "${SSH[@]}" ... "${SCP[@]}" ... ``` 3. **Quote remote arguments safely** - Serialize the path using `printf '%q'` before embedding it in a remote shell command. - Prefer invoking a fixed, audited remote deployment script with data supplied through positional parameters or standard input. Example: ```bash printf -v quoted_data '%q' "$VPS_DATA" "${SSH[@]}" "mkdir -p -- ${quoted_data}/workspace-pat/memory" ``` 4. **Reject SSH option injection** - Validate the VPS value as an expected `user@hostname` or hostname format. - Do not allow it to begin with `-`. - Keep user-controlled values in distinct array elements. - Pin expected SSH options in the script rather than accepting arbitrary options through argument fields. 5. **Replace root SSH deployment** - Create a dedicated deployment account. - Restrict its write access to the OpenClaw deployment directory. - Grant only a narrowly scoped command for restarting the intended container. - Consider SSH `authorized_keys` restrictions such as a forced command and disabled forwarding. - Do not grant unrestricted membership in the Docker group, because it is generally equivalent to root access. 6. **Add defensive SSH settings** - Use a managed `known_hosts` file and strict host-key verification. - Ensure the selected key has restrictive local permissions. - Avoid logging key material or sensitive co ...[truncated 24 chars]

T02 · Agent Memory Poisoning

Warning
Location
memory_sync.py:35
Finding

Untrusted Cross-Agent Content Is Propagated Into Persistent Memory

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description significantly overstates what this code chunk does. The script is limited to local filesystem scaffolding for agent workspaces: it creates directories and writes a few template/config files. It does not deploy agents, configure routing, synchronize memory across agents, or perform any cloud deployment. While 'agent creation' via workspace setup is partially represented, the primary declared purpose of a production-ready multi-agent deployment toolkit is not supported by this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a broad deployment toolkit for provisioning and deploying a multi-agent fleet, with multiple automation capabilities. The supplied code chunk implements only one narrow utility: syncing a specific markdown section across existing agent memory files. While 'memory sync' is mentioned in the description, the code does not support the larger declared primary purpose of fleet deployment, setup, routing, or cloud deployment. This is therefore a material description-behavior mismatch for this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The supplied code is much narrower than the declared description. It statically defines four agent templates and writes them into an openclaw.json file, replacing existing agents.list if the file exists. That fits only a small part of 'routing config' generation. It does not deploy anything, create agents in a remote system, synchronize memory, provision cloud resources, or implement a broader production setup workflow. Because the description presents a substantially broader capability set than what this code actually performs, this is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · deploy.sh (reported line 8)May include surrounding context.

sh
set -e

VPS=""
KEY="~/.ssh/id_rsa"
VPS_DATA="/docker/openclaw-pkpz/data/.openclaw"
LOCAL_DIR="$(cd "$(dirname "$0")" && pwd)"

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · deploy.sh (reported line 42)May include surrounding context.

sh
[ -f "$LOCAL_DIR/workspace-$agent/$f" ] && \
                $SCP "$LOCAL_DIR/workspace-$agent/$f" "$VPS:$VPS_DATA/workspace-$agent/$f"
        done
        [ -f "$LOCAL_DIR/workspace-$agent/.claude/settings.json" ] && \
            $SCP "$LOCAL_DIR/workspace-$agent/.claude/settings.json" \
                 "$VPS:$VPS_DATA/workspace-$agent/.claude/settings.json"
    fi

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · deploy.sh (reported line 43)May include surrounding context.

sh
[ -f "$LOCAL_DIR/workspace-$agent/$f" ] && \
                $SCP "$LOCAL_DIR/workspace-$agent/$f" "$VPS:$VPS_DATA/workspace-$agent/$f"
        done
        [ -f "$LOCAL_DIR/workspace-$agent/.claude/settings.json" ] && \
            $SCP "$LOCAL_DIR/workspace-$agent/.claude/settings.json" \
                 "$VPS:$VPS_DATA/workspace-$agent/.claude/settings.json"
    fi

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · deploy.sh (reported line 44)May include surrounding context.

sh
[ -f "$LOCAL_DIR/workspace-$agent/$f" ] && \
                $SCP "$LOCAL_DIR/workspace-$agent/$f" "$VPS:$VPS_DATA/workspace-$agent/$f"
        done
        [ -f "$LOCAL_DIR/workspace-$agent/.claude/settings.json" ] && \
            $SCP "$LOCAL_DIR/workspace-$agent/.claude/settings.json" \
                 "$VPS:$VPS_DATA/workspace-$agent/.claude/settings.json"
    fi

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill advertises automation that creates files and modifies deployment-related configuration, but the manifest does not declare any explicit tool scope or allowed-tools constraints. In an agent ecosystem, missing capability declarations weaken review and consent boundaries, making it easier for file-writing behavior to occur without clear operator awareness.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The deployment step tells users to run a shell script against a remote VPS as root, but does not prominently warn that it will upload files and restart the running container. In a production deployment context, that omission can cause unintended service disruption, accidental overwrite of remote state, or unsafe execution by users who do not realize the operational impact.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script rewrites each agent's MEMORY.md in place without prompting, creating a backup, or using any transactional safety checks. In a production multi-agent deployment context, this can unintentionally destroy or duplicate user-maintained memory content across multiple workspaces if the wrong base path or agent list is supplied, making the issue more operationally dangerous than in a one-off local utility.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.