Back to skill

Security audit

Multi-Agent Create

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its stated agent-setup purpose, but it asks for powerful messaging credentials in chat and contains unsafe setup-script handling that can persistently alter agent files.

Review before installing. Do not paste real bot tokens, app secrets, or service-account keys into chat; provision them through a secret manager, protected local config, or environment variables instead. Use only simple validated agent identifiers, inspect generated workspace files and openclaw.json changes before activation, and avoid restarting a live gateway until you understand the impact.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/setup-agent.sh:13
Finding
Path Traversal Through an Unvalidated Agent Name Allows File Overwrite Outside the Workspace Root<![CDATA[ ## Vulnerability Details **File Location**: `scripts/setup-agent.sh:13-18, 27-70` **Vulnerability Type**: Path traversal and unsafe file overwrite **Risk Level**: High ### Vulnerable Code ```bash AGENT_NAME="${1:?Usage: setup-agent.sh <name> <channel> [credentials...]}" CHANNEL="${2:?Please specify channel: telegram|discord|slack|feishu|whatsapp|signal|googlechat}" AGENT_ID="${AGENT_NAME,,}-agent" AGENT_DIR="${AGENT_NAME,,}" STATE_DIR="${OPENCLAW_STATE_DIR:-$HOME/.openclaw}" WORKSPACE_DIR="${STATE_DIR}/workspace-groups/${AGENT_DIR}" CONFIG_PATH="${STATE_DIR}/openclaw.json" ``` ```bash # 2. Create workspace mkdir -p "${WORKSPACE_DIR}" # 3. Register agent openclaw agents add "${AGENT_ID}" 2>/dev/null || true # 4. Generate workspace files cat > "${WORKSPACE_DIR}/IDENTITY.md" << EOF # IDENTITY.md - **Name:** ${AGENT_NAME} - **Role:** [Define role here] - **Emoji:** 🤖 EOF cat > "${WORKSPACE_DIR}/SOUL.md" << EOF # SOUL.md You are ${AGENT_NAME}, an independent AI assistant. Be genuinely helpful. Have opinions. Try before asking. Keep private things private. Never send half-baked replies. EOF cat > "${WORKSPACE_DIR}/AGENTS.md" << EOF # AGENTS.md ## On startup 1. Read SOUL.md 2. Read IDENTITY.md 3. Read USER.md if present ## Memory Write important notes to memory/YYYY-MM-DD.md EOF cat > "${WORKSPACE_DIR}/USER.md" << EOF # USER.md - **Name:** [User Name] - **Timezone:** UTC EOF touch "${WORKSPACE_DIR}/HEARTBEAT.md" touch "${WORKSPACE_DIR}/TOOLS.md" ``` ### Technical Analysis The script directly incorporates the caller-controlled `AGENT_NAME` into `WORKSPACE_DIR`. It does not enforce an identifier format, reject path separators, or verify the canonical destination against the intended `workspace-groups` directory. An agent name containing `../` components can make the effective workspace resolve outside `${STATE_DIR}/workspace-groups`. The script then creates the resulting directory and unconditionally redirects content into fixed filenames s ...[truncated 1934 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Enforce a strict machine-readable identifier before constructing any path: ```bash if [[ ! "$AGENT_NAME" =~ ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$ ]]; then echo "Invalid agent name" >&2 exit 1 fi ``` 2. Maintain separate values for a validated directory identifier and a human-readable display name. 3. Canonicalize the workspace root and destination, then verify that the destination remains a direct child of the workspace root. 4. Reject names containing `/`, `\`, `..`, newlines, control characters, or leading hyphens. 5. Refuse to overwrite an existing workspace unless the user explicitly requests a safe update operation. 6. Use protections against symbolic-link traversal. Verify directories and files with `lstat`-equivalent checks and create new files using no-follow and exclusive-creation semantics where possible. 7. Write generated content to safely created temporary files in the destination and atomically rename them only after validation. 8. Add tests covering traversal strings, absolute-looking paths, repeated separators, control characters, and pre-existing symbolic links. ]]>

T02 · Agent Memory Poisoning

Error
Location
scripts/setup-agent.sh:13
Finding
Untrusted Agent Names Can Persistently Inject Instructions Into Agent Startup Files<![CDATA[ ## Vulnerability Details **File Location**: `scripts/setup-agent.sh:13-16, 33-56` **Vulnerability Type**: Persistent prompt injection through generated agent state **Risk Level**: High ### Vulnerable Code ```bash AGENT_NAME="${1:?Usage: setup-agent.sh <name> <channel> [credentials...]}" CHANNEL="${2:?Please specify channel: telegram|discord|slack|feishu|whatsapp|signal|googlechat}" AGENT_ID="${AGENT_NAME,,}-agent" AGENT_DIR="${AGENT_NAME,,}" ``` ```bash cat > "${WORKSPACE_DIR}/IDENTITY.md" << EOF # IDENTITY.md - **Name:** ${AGENT_NAME} - **Role:** [Define role here] - **Emoji:** 🤖 EOF cat > "${WORKSPACE_DIR}/SOUL.md" << EOF # SOUL.md You are ${AGENT_NAME}, an independent AI assistant. Be genuinely helpful. Have opinions. Try before asking. Keep private things private. Never send half-baked replies. EOF cat > "${WORKSPACE_DIR}/AGENTS.md" << EOF # AGENTS.md ## On startup 1. Read SOUL.md 2. Read IDENTITY.md 3. Read USER.md if present ## Memory Write important notes to memory/YYYY-MM-DD.md EOF ``` ### Technical Analysis `AGENT_NAME` is treated both as an identifier and as trusted natural-language content. It is interpolated without validation into `IDENTITY.md` and `SOUL.md`. A quoted shell argument may contain newline characters and Markdown content. Consequently, a crafted name can terminate the intended sentence or field and append arbitrary instructions to these files. The generated `AGENTS.md` explicitly tells the new agent to read `SOUL.md` and `IDENTITY.md` on startup, turning the injected content into persistent agent state. This differs from a transient prompt injection because the payload is saved to disk and can affect future sessions whenever the workspace is loaded. ### Attack Path 1. The attacker controls or influences the name supplied during agent creation. 2. The attacker supplies a multiline name containing additional Markdown instructions. 3. The helper script interpolates the complete value into `IDENTITY.md` and `SOU ...[truncated 1176 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Restrict the machine-readable agent name to a short, single-line identifier containing only letters, digits, underscores, and hyphens. 2. Reject newline characters, carriage returns, tabs, control characters, Markdown delimiters, and path separators. 3. Keep the agent identifier separate from the display name. 4. Do not insert untrusted display text into files that are interpreted as agent instructions. 5. If a display name must be stored, place it in a structured data file such as JSON and serialize it with a real JSON encoder. 6. Generate `SOUL.md` and other behavioral files exclusively from trusted templates. 7. Clearly mark external metadata as untrusted data and ensure startup instructions tell the agent not to treat metadata as executable instructions. 8. Require explicit user review of generated behavioral and startup files before activating or binding the agent. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:60
Finding
Messaging Platform Secrets Are Requested Through the Conversational Transcript<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:60-85` **Vulnerability Type**: Insecure collection of plaintext credentials **Risk Level**: Medium ### Vulnerable Code ```markdown #### Telegram > 🔑 **Get your Telegram Bot Token:** > 1. Open Telegram and search for **@BotFather** > 2. Send `/newbot` and follow the prompts to name your bot > 3. BotFather will give you a **Bot Token** like `123456789:ABCdefGHI...` > 4. Paste that token here Required: `botToken` #### Discord > 🔑 **Get your Discord Bot Token:** > 1. Go to [Discord Developer Portal](https://discord.com/developers/applications) > 2. Click **New Application** → name it → go to **Bot** tab > 3. Click **Reset Token** and copy the token > 4. Under **Privileged Gateway Intents**, enable **Message Content Intent** > 5. Paste the token here Required: `token` #### Slack > 🔑 **Get your Slack App credentials:** > 1. Go to [Slack API](https://api.slack.com/apps) → **Create New App** > 2. Enable **Socket Mode** → copy the **App-Level Token** (starts with `xapp-`) > 3. Go to **OAuth & Permissions** → install to workspace → copy the **Bot Token** (starts with `xoxb-`) > 4. Paste both tokens here Required: `appToken`, `botToken` ``` ### Technical Analysis The skill explicitly instructs users to paste Telegram, Discord, and Slack credentials into the conversation. Secrets submitted this way become part of the model context and may also be retained in chat history, application logs, observability systems, backups, debugging traces, or model-provider telemetry. The repository does not contain code that intentionally transmits these credentials to a separate attacker-controlled endpoint. The security issue is the collection method itself: a general conversational channel is being used as a plaintext secret-entry mechanism without documented redaction, retention controls, or secure storage boundaries. ### Attack Path 1. A user follows the documented channel-configuration workflow. 2. The us ...[truncated 1190 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not ask users to paste tokens or application secrets into the conversation. 2. Collect secrets through a hidden terminal prompt, local administrative interface, operating-system keychain, or dedicated secret manager. 3. Support environment-variable or protected-file references rather than raw secret values. 4. Ensure secrets are passed directly to the trusted local configuration mechanism without entering model context. 5. Disable command tracing and avoid printing secret-bearing commands or values. 6. Apply restrictive filesystem permissions to any local credential file. 7. Document credential rotation and revocation procedures. 8. If conversational collection cannot immediately be removed, implement automatic redaction before logging and clearly warn users about transcript retention; however, redaction should be treated only as a temporary mitigation. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (11)

Missing User Warnings

High
Confidence
98% confidence
Finding
The skill explicitly asks users to paste highly sensitive bot tokens, app secrets, and service account material into chat without any warning about secrecy, retention, or safer handling. This is dangerous because chat transcripts, logs, model providers, or downstream tooling may expose long-lived credentials that grant control over external messaging accounts.

Ssd 3

High
Confidence
99% confidence
Finding
The skill is designed to solicit and receive sensitive channel credentials directly through the model conversation, including bot tokens, app secrets, and service account paths. This is a direct secret-handling anti-pattern because the assistant becomes a collection point for credentials that may be logged, retained, or exposed, enabling takeover of integrated messaging channels.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill asks users to obtain and likely input sensitive platform credentials such as bot tokens, app secrets, and service account JSON, but it provides no warning about secure handling, storage, or exposure risks. Because these credentials can grant control over messaging integrations, poor handling could result in account compromise, unauthorized bot actions, or leakage of privileged access.

External Transmission

Medium
Category
Data Exfiltration
Content
|---------|-------------------|
| **Telegram** | Bot Token (from [@BotFather](https://t.me/BotFather)) |
| **Discord** | Bot Token (from [Developer Portal](https://discord.com/developers/applications)) |
| **Slack** | App Token + Bot Token (from [Slack API](https://api.slack.com/apps)) |
| **Feishu / Lark** | App ID + App Secret (from [飞书开放平台](https://open.feishu.cn/)) |
| **WhatsApp** | QR code scan |
| **Signal** | QR code scan |
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
|---------|-------------------|
| **Telegram** | Bot Token (from [@BotFather](https://t.me/BotFather)) |
| **Discord** | Bot Token (from [Developer Portal](https://discord.com/developers/applications)) |
| **Slack** | App Token + Bot Token (from [Slack API](https://api.slack.com/apps)) |
| **Feishu / Lark** | App ID + App Secret (from [飞书开放平台](https://open.feishu.cn/)) |
| **WhatsApp** | QR code scan |
| **Signal** | QR code scan |
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The invocation phrases 'Create a new agent' and 'Add a bot' are broad, natural-language triggers that can easily overlap with ordinary user requests. In an agentic environment, this raises the risk of the skill activating unintentionally and causing workspace creation or configuration changes without the user clearly intending to invoke this specific capability.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The README states that workspaces are auto-generated and gateway configuration is updated automatically, but it does not clearly warn that running the skill will modify local files and service configuration. This can lead to unexpected persistent changes, accidental agent registration, or misconfiguration if users invoke the skill without understanding its side effects.

Vague Triggers

Medium
Confidence
91% confidence
Finding
The trigger examples are broad enough to match ordinary user requests like 'create a new agent' or 'add a bot', which can cause the skill to activate in situations where the user did not intend to begin infrastructure changes. In this skill, unintended activation is more dangerous because the workflow proceeds toward credential collection and gateway configuration changes.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The Feishu section switches to Chinese-only instructions and asks the user to provide credentials in that context, without offering a language choice or explaining that Chinese is required. This can violate language/locale policy expectations when the rest of the skill is written in English and no opt-in is provided.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The skill directs execution of commands that create workspaces, register agents, alter channel bindings, and restart the gateway, but it does not warn about service disruption, config mutation, or the need to review changes first. In this operational context, an accidental or misunderstood run could interrupt live services or leave the system in a broken state.

Missing User Warnings

Low
Confidence
82% confidence
Finding
This shell script backs up configuration, creates directories, and writes multiple workspace files under the user's OpenClaw state directory. Although it prints progress messages, it does not clearly disclose up front that it will create and modify persistent local files and configuration-related state.

Static analysis

No suspicious patterns detected.