Back to skill

Security audit

create-agents-wizard

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent agent-workspace scaffolding skill that writes user-approved OpenClaw files, with a command-quoting hardening issue users should watch.

Review every generated AGENTS/SOUL/IDENTITY/BOOTSTRAP/USER/STYLE file before confirming writes. Use normal, trusted workspace paths, avoid passing untrusted path text, and ensure any OpenClaw CLI command is executed with structured arguments or proper shell quoting, especially when paths contain spaces or symbols. Use --force only when you intend to overwrite existing workspace files.

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

Error
Location
SKILL.md:46
Finding
Command Injection Through an Unquoted User-Controlled Workspace Path<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 46–48 **Vulnerability Type**: Shell command injection **Risk Level**: High ### Vulnerable Code ```markdown After required files for one agent are confirmed: 1. If agent does not exist, create it: - `openclaw agents add <id> --workspace <path>` ``` ### Technical Analysis The workflow collects the workspace path from the user and later instructs the agent to interpolate that value into a shell command. The command template does not quote `<path>` or require execution through a structured argument-array API. Although agent IDs are restricted to lowercase letters, digits, and hyphens, no equivalent validation is specified for workspace paths. If the rendered command is passed to a shell, metacharacters in a malicious workspace value can terminate or alter the intended command and introduce additional commands. For example, a workspace value containing a command separator could cause the shell to interpret the remainder as a separate command. The vulnerability depends on the agent rendering this template with the supplied value and invoking it through a shell rather than a non-shell process API. ### Attack Path 1. An attacker or untrusted user requests creation of an agent. 2. The attacker supplies a workspace path containing shell metacharacters, such as: ```text /tmp/work; <attacker-command> ``` 3. The agent substitutes that value into the documented command: ```sh openclaw agents add example --workspace /tmp/work; <attacker-command> ``` 4. The agent executes the rendered string through a shell. 5. The shell runs the intended `openclaw` command and then executes the injected command with the operating-system privileges of the agent process. ### Impact Assessment Successful exploitation can provide arbitrary command execution under the account running the agent. The attacker could read or modify files accessible to that account, alter agent workspaces, expose lo ...[truncated 302 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Use a process-execution API that accepts the executable and arguments as a structured array, without invoking a shell: ```text ["openclaw", "agents", "add", id, "--workspace", workspace] ``` 2. If shell execution is unavoidable, quote every substituted argument: ```sh openclaw agents add "$id" --workspace "$workspace" ``` 3. Validate the workspace path before execution: - Reject control characters, newlines, and null bytes. - Require an absolute path or explicitly resolve permitted relative paths. - Normalize the path and enforce any intended allowed-root restriction. - Do not construct a command by concatenating raw user input. 4. Preserve the existing agent-ID allowlist and validate it immediately before command execution. 5. Update the Skill instructions to explicitly prohibit shell-string interpolation and require confirmation that displays the normalized agent ID and workspace path as data, not as an executable command. 6. Add tests covering paths containing spaces, quotes, semicolons, command substitutions, redirection operators, and newlines to verify that they remain a single inert argument. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (4)

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding
The code does relate to agent workspace setup and the six named files, so it is in the same general domain. However, the declared description promises a guided, likely interactive workflow for creating multiple agents in batch, collecting preferences per agent, drafting and confirming files, then writing and summarizing results. The actual script is much narrower: it operates on one agent/workspace at a time, creates placeholder files if missing, or copies existing files from a provided directory. It does not implement batch creation, preference collection, confirmation steps, or substantive customization logic. This is a material scope and behavior mismatch rather than a minor implementation detail.

Self-Modification

High
Category
Rogue Agent
Content
--agent <id>        Agent id (for display/log only)
  --workspace <path>  Target workspace path
  --from <dir>        Source dir containing any of the 6 files to copy
  --force             Overwrite existing files when copying from --from
  -h, --help          Show this help
EOF
}
Confidence
85% confidence
Finding
Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Session Persistence

Medium
Category
Rogue Agent
Content
---
name: create-agents-wizard
description: Guided creation of multiple OpenClaw agents and their workspace templates. Use when users ask to create agents in batch, configure new agents, or customize AGENTS/SOUL/IDENTITY/BOOTSTRAP/USER/STYLE files. The workflow confirms scope, collects preferences agent-by-agent, drafts and confirms files, writes to disk, and summarizes results.
---

# Create Agents Wizard
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.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
Rules:
- Do not dump a long questionnaire; ask in small rounds (2–4 key questions each).
- Preserve user intent; do not change direction without consent.
- Respect selected mode (Standard 6 files or Fast 2 files).
- If user requests partial scaffolding, allow writing only the confirmed subset and continue/stop as requested.
Confidence
75% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Static analysis

No suspicious patterns detected.