Back to skill

Security audit

Agent Deploy

Security checks for vulnerabilities and agentic risk

Overview

This skill manages OpenClaw agents as advertised, but it broadly copies credentials into new agents and performs sensitive config changes with weak scoping and confirmation.

Install only if you are comfortable with this skill modifying OpenClaw agent configuration and copying existing API credentials into newly deployed agents. Prefer reviewing or changing it first so credentials are explicitly allowlisted, tokens are not passed on the command line, removal requires confirmation, and generated auth files are securely permissioned and cleaned up on failure or removal.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (4)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/deploy_helper.py:115
Finding

Broad Credential Replication Violates Agent Isolation and Least Privilege

Content
View full analysis
{agent_auth_path}") ``` The behavior is also explicitly described in `SKILL.md:95-96`: ```markdown - Merges API keys from BOTH global config (`openclaw.json` auth.profiles) AND m ...[truncated 1781 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/deploy_helper.py:148
Finding

Plaintext Credential Files Lack Enforced Permissions and Lifecycle Cleanup

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/deploy.sh:6
Finding

Telegram Bot Token Is Exposed Through Process Arguments and Console Output

Content
View full analysis
``` The deployment script accepts the secret as a positional argument and prints a token prefix: ```bash AGENT_ID="${1:?Usage: deploy.sh [workspace_path]}" BOT_TOKEN="${2:?Usage: deploy.sh [workspace_path]}" ``` ```bash echo " Agent: $AGENT_ID" echo " Token: ${BOT_TOKEN:0:10}..." echo " Workspace: $WORKSPACE" echo " Config: $CONFIG" ``` It then places the complete token in another process's arguments: ```bash PREFLIGHT=$(python3 "$HELPER" preflight "$AGENT_ID" "$BOT_TOKEN" 2>&1) || { echo "$PREFLIGHT" exit 1 } ``` The listing action also prints the beginning of stored tokens: ```python token = accounts.get(tg_acct, {}).get("botToken", "N/A") t_short = token[:10] + "..." if len(token) > 10 else token ``` ### Technical Analysis Command-line arguments are not an appropriate secret transport mechanism. Depending on the operating system and process visibility settings, arguments can be exposed through process-listing tools or process metadata. The invoking command may also be retained in shell history, agent execution logs, orchestration telemetry, or audit records. The deployment creates two observable argument vectors containing the complete token: the Bash invocation and the Python preflight invocation. Printing the first ten characters in deploy and list output also discloses unnecessary credential metadata and can propagate it into conversation logs or monitoring systems. ### Attack Path 1. An operator or AI agent invokes `deploy.sh` with the Telegram token as a pos ...[truncated 975 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/deploy.sh:6
Finding

Missing Agent Identifier Validation Enables Unsafe Path and Configuration-Key Handling

Content
View full analysis
[workspace_path]}" BOT_TOKEN="${2:?Usage: deploy.sh [workspace_path]}" WORKSPACE="${3:-$HOME/.openclaw/workspace-$AGENT_ID}" CONFIG="${OPENCLAW_CONFIG_PATH:-$HOME/.openclaw/openclaw.json}" BACKUP="$HOME/.openclaw/openclaw.json.pre-$AGENT_ID" OC="${OPENCLAW_BIN:-openclaw}" HELPER="$(dirname "$0")/deploy_helper.py" ``` The script creates directories from the derived or caller-provided workspace path: ```bash echo "[3/8] Create workspace..." mkdir -p "$WORKSPACE/memory" "$WORKSPACE/output" "$WORKSPACE/skills" if [ ! -f "$WORKSPACE/SOUL.md" ]; then printf '# Agent\n\nYou are a helpful AI assistant.\n' > "$WORKSPACE/SOUL.md" echo " Created default SOUL.md" fi ``` The unvalidated identifier is interpolated into a dotted configuration key: ```bash $OC config set "channels.telegram.accounts.$AGENT_ID" "$ACCT_JSON" || { echo "ERROR: Failed to set telegram account. Rolling back..." cp "$BACKUP" "$CONFIG" exit 1 } ``` The helper also uses the identifier in an authentication path: ```python agent_id = sys.argv[2] agent_auth_path = os.path.expanduser( f"~/.openclaw/agents/{agent_id}/agent/auth-profiles.json" ) ``` The documentation claims a validation rule that the implementation does not enforce: ```markdown 3. **NEVER change the agentId format.** It must be lowercase letters, numbers, and hyphens only. No spaces, no uppercase, no special characters. ``` ### Technical Analysis The documented identifier grammar is lowercase letters, numbers, and hyphens, but ne ...[truncated 2104 chars]
Remediation
View remediation
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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill is presented as a deployment skill, yet it also includes a destructive removal operation that can delete agent bindings and account configuration. Hiding destructive functionality behind a create/deploy-oriented description makes accidental or unauthorized invocation more likely, especially in agentic systems that rely on manifest descriptions for routing and trust decisions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as a deployment skill, yet it also includes a destructive removal operation that can delete agent bindings and account configuration. Hiding destructive functionality behind a create/deploy-oriented description makes accidental or unauthorized invocation more likely, especially in agentic systems that rely on manifest descriptions for routing and trust decisions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a deployment skill, yet it also includes a destructive removal operation that can delete agent bindings and account configuration. Hiding destructive functionality behind a create/deploy-oriented description makes accidental or unauthorized invocation more likely, especially in agentic systems that rely on manifest descriptions for routing and trust decisions.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill instructs direct execution of an agent removal script without any confirmation, preview, or warning despite the action being destructive. In an agentic environment, this creates a significant risk of accidental deletion from a mistaken request, ambiguous routing, or prompt-manipulated invocation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script prints that the deployed agent has sandbox restrictions such as non-main mode, agent scope, no workspace access, and denied gateway tools, but it never actually configures those controls. This creates a dangerous mismatch between operator expectations and real security posture, so users may deploy agents believing they are constrained when they are not.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The merge-auth action copies authentication profiles from global and main-agent stores into a newly created agent, effectively propagating credentials across trust boundaries. In a multi-agent system, this broadens access for the new agent and undermines isolation, so compromise or misuse of one agent can inherit secrets intended for other contexts.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill instructs execution of shell scripts and handling of secrets, but the manifest does not declare any tool scope or allowed-tools boundaries. This increases the risk that an agent platform may grant broader-than-necessary file or environment access, enabling unintended writes or exposure of sensitive configuration and bot tokens during deployment operations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger guidance uses broad language like 'or similar,' making activation boundaries ambiguous for an agent that may auto-select this skill. In a skill capable of modifying configuration, deploying bots, or removing agents, vague routing conditions raise the chance of unintended execution in response to loosely related user requests.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script logs the first part of the bot token to stdout, which can expose credential material in shell history capture, CI logs, terminal recording, or centralized logging systems. Even partial secret disclosure increases the chance of token identification and mishandling, especially in operational environments where logs are widely accessible.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script claims to create an isolated agent, yet it explicitly merges authentication profiles from global or main-agent state into the new agent. That breaks isolation boundaries and can grant the new agent access to API keys or credentials it should not inherit, increasing blast radius if the new agent is compromised or misconfigured.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The top-level docstring narrows the helper's purpose to 'pre-flight checks + config generation'. In reality, later branches perform unrelated operational tasks including listing agents, removing config entries, migrating existing bot configuration, and writing merged auth data to disk, which actively contradicts the stated scope of the module.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

The helper loads openclaw.json, later compares botToken values and merges auth profiles from auth files, which involves access to credential-bearing data. There is no visible warning, comment, or user-facing log explaining that the script accesses sensitive tokens/auth profile information.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The list action enumerates configured Telegram accounts and prints a visible prefix of each bot token. Even though it truncates the value, exposing secret material and account inventory exceeds the helper's deployment role and creates unnecessary credential disclosure risk through logs, terminal history, screenshots, or delegated tool output.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code performs a file write to an auth-related path containing merged credential/profile data, but there is no confirmation prompt, warning comment/docstring, or user-facing disclosure immediately describing that sensitive auth data will be written. For a code file, writing authentication material is a safety-relevant operation that should be clearly disclosed.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest says the skill deploys new agents, but the body also documents listing and removing agents. This scope drift weakens transparency and can cause systems or users to invoke a skill expecting creation-only behavior while unknowingly granting access to reconnaissance and destructive operations.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.