Back to skill

Security audit

OpenClaw Agent 创建器

Security checks for vulnerabilities and agentic risk

Overview

This skill is meant to create OpenClaw agents, but it needs review because it can copy credentials, store app secrets in plaintext, and seed new agents with persistent personal/project memory.

Review before installing or using. Prefer empty auth.json for new agents, do not copy main-agent credentials, use separate scoped credentials per agent, avoid pasting Feishu appSecret into chat, store secrets through a secure secret mechanism or environment reference, and replace the bundled MEMORY.md personal/project data with neutral placeholders before generating agents.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:33
Finding
Main-Agent Credentials Can Be Copied into Newly Created Agents## Vulnerability Details **File Location**: `SKILL.md`, lines 33-36 **Vulnerability Type**: Credential inheritance across agent trust boundaries **Risk Level**: High ### Vulnerable Code Snippet ```markdown In `~/.openclaw/workspace-{agentId}/agent/`, create: | File | Content | |------|---------| | **models.json** | Model configuration copied from the main agent, with the provider modified | | **auth.json** | Authentication configuration: an empty object `{}` or copied from the main agent | ``` ### Technical Analysis The documented workflow explicitly permits copying the main agent's `auth.json` into a newly created agent. Authentication configuration can contain API credentials, provider tokens, session credentials, or references granting access to protected resources. A new agent is a separate execution identity and workspace. Copying credentials from the main agent violates least privilege because the new agent may inherit authority unrelated to its intended task. The procedure does not require credential filtering, scope reduction, rotation, separate service identities, or explicit confirmation before copying authentication material. ### Attack Path 1. An operator creates a new agent using this skill. 2. The operator or automated agent follows the documented option to copy the main agent's `auth.json`. 3. The new workspace receives the main agent's authentication material. 4. A malicious prompt, compromised subagent, or process with access to the new workspace reads or uses those credentials. 5. The attacker accesses provider resources with the main agent's privileges rather than the limited privileges required by the new agent. ### Impact Assessment Exploitation can expose every provider or service represented in the copied authentication file. The resulting privileges depend on the copied credentials, but may include model API use, account-level resource access, unauthorized expenditure, access to protec ...[truncated 197 chars]
Remediation
## Remediation Suggestions - Remove the option to copy the main agent's `auth.json`. - Initialize every new agent with an empty authentication object by default. - Provision a separate service identity and credential set for each agent. - Limit credentials to the exact providers, operations, resources, and duration required. - Require explicit user authorization before migrating any existing credential. - If migration is necessary, use an allowlist to copy only approved non-secret configuration fields. - Store credentials in a secret manager rather than directly in workspace files. - Enforce restrictive filesystem permissions and audit access to authentication material. - Rotate any main-agent credentials that have already been duplicated.

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:108
Finding
Feishu Application Secrets Are Requested Through Conversation and Stored in Plaintext## Vulnerability Details **File Location**: `SKILL.md`, lines 108-134 **Vulnerability Type**: Plaintext secret collection and storage **Risk Level**: High ### Vulnerable Code Snippet ```markdown ### Information required from the user 1. **accountId**: Feishu bot account ID, such as `longcat` 2. **botName**: Bot name 3. **appId**: Feishu application ID 4. **appSecret**: Feishu application secret ``` ```json "{accountId}": { "appId": "{appId}", "appSecret": "{appSecret}", "botName": "{botName}" } ``` ### Technical Analysis The skill instructs the agent to ask the user for an application secret and then place that secret directly into `openclaw.json`. This creates two plaintext exposure points: the conversation used to collect the secret and the configuration file used to store it. The workflow does not prescribe a secret manager, environment-variable reference, encrypted credential store, output redaction, restrictive file permissions, log suppression, or secret rotation. Chat transcripts and configuration files are commonly retained in logs, backups, debugging output, and workspace snapshots, which increases the probability of unintended disclosure. ### Attack Path 1. The agent asks the user to provide `appSecret` in a normal conversation. 2. The raw secret becomes part of the conversation history and associated logs. 3. The agent writes the same secret into `openclaw.json`. 4. A user, process, backup reader, diagnostic tool, or compromised agent obtains access to either the transcript or configuration file. 5. The exposed application credentials are used to authenticate to the Feishu application or impersonate the configured bot, subject to the permissions assigned to that application. ### Impact Assessment A disclosed `appSecret` may permit unauthorized use of the associated Feishu application. Depending on the application's configured scopes, an attacker may impersonate the bot, access a ...[truncated 294 chars]
Remediation
## Remediation Suggestions - Do not request raw application secrets through ordinary chat messages. - Use a secure secret-entry mechanism that prevents values from entering conversation history. - Store secrets in an operating-system credential store, vault, or dedicated secret manager. - Replace the plaintext value in `openclaw.json` with a secret reference or environment-variable reference. - Ensure logs and command output redact secret values. - Apply restrictive permissions to all files containing authentication configuration. - Avoid including secrets in generated examples, status output, exceptions, or backups. - Validate that the Feishu application uses the minimum necessary scopes. - Document revocation and rotation procedures and rotate any secret previously submitted through chat.

T02 · Agent Memory Poisoning

Error
Location
templates/AGENTS.md:7
Finding
Persistent Memory Instructions Allow Untrusted Content to Influence Future Sessions## Vulnerability Details **File Location**: `templates/AGENTS.md`, lines 7-96 **Vulnerability Type**: Persistent memory poisoning and excessive retention **Risk Level**: High ### Vulnerable Code Snippet ```markdown Before doing anything: 1. Read `SOUL.md` — who you are 2. Read `USER.md` — who you are helping 3. Read `MEMORY.md` — hot-cache context 4. Read today's daily log for recent events ``` ```markdown Memory is limited. If you want to remember something, write it to a file. "Mental notes" do not survive session restarts. Files do. **A daily journal must be written every day.** Use the daily-log skill and record it according to the specification. ``` ```markdown Every entity uses `items.json` for tracking: - Add new facts as new entries with `status: active` - Mark old facts as `superseded`, with `supersededBy` pointing to the new entry - Do not delete any record; retain a fully traceable history When a change occurs: 1. Read the existing `items.json` 2. Change the old entry's status to `superseded` and add `supersededBy` 3. Add the new entry with `status: active` 4. Update `summary.md` to the latest snapshot ``` ### Technical Analysis The template requires generated agents to read persistent memory before handling requests and to continuously write daily events, people, projects, environmental information, and learned facts into long-term files. It also directs agents not to delete historical records. Persistent memory becomes a security boundary because its contents influence future sessions. The template provides no trust labeling, provenance tracking, instruction sanitization, approval requirement, sensitivity filtering, retention period, or mechanism to prevent user-supplied text from being stored as executable behavioral instructions. If untrusted content is written into `MEMORY.md`, a daily log, an entity record, or another automatically consulted memory file, it can repeatedly af ...[truncated 1461 chars]
Remediation
## Remediation Suggestions - Make persistent memory opt-in rather than mandatory. - Treat all memory content as untrusted data, never as higher-priority instructions. - Store provenance, author, timestamp, source channel, and confidence for every memory entry. - Prevent instruction-like text from being promoted into automatically loaded memory. - Require explicit user approval before storing sensitive or behavior-changing information. - Separate factual memory from agent policy and ensure memory cannot override system or developer instructions. - Add validation and sanitization before writing imported or user-controlled content. - Define retention periods and provide correction, deletion, and complete purge mechanisms. - Avoid automatically reading all daily logs before every request; retrieve only task-relevant records. - Limit subagents' ability to write directly to shared memory. - Record an audit trail for memory changes and support rollback to a known-good state.

other

Warning
Location
templates/MEMORY.md:5
Finding
Mandatory Template Copying Propagates Hardcoded Personal and Operational Data## Vulnerability Details **File Location**: `templates/MEMORY.md`, lines 5-46 **Vulnerability Type**: Privacy data contamination across agent workspaces **Risk Level**: Medium ### Vulnerable Code Snippet ```markdown ## Me - **Name**: Little Claw - **Type**: AI Assistant (Subagent Runtime) - **Role**: Studio Member Agent - **Platform**: OpenClaw (Gateway localhost:18789) - **Location**: Near Century Park, Shanghai ## People | Who | Identity | |-----|----------| | **AxelHu** | System owner, user | | **Producer** | Game producer, workspace-gaming | | **Designer** | Game designer, workspace-gaming | | **Programmer** | Programmer, workspace-gaming | | **Artist** | Art designer, workspace-gaming | ``` ```markdown ## Projects | Project | Status | |---------|--------| | **AI Game Studio** | Active, four-agent architecture under validation | | **OpenClaw Multi-Agent** | Active, routine studio operations | ``` ### Technical Analysis The memory template contains non-placeholder identity, location, role, project, workspace, and infrastructure information. The creation workflow in `SKILL.md` requires this template to be copied into every generated workspace. As a result, unrelated agents inherit personal and operational context by default. This violates data minimization and creates cross-agent contamination: a newly created agent may treat information from the template as facts about its own user, environment, or authorization context. The local gateway address is not independently sensitive, but in combination with owner identity, physical location, workspace names, roles, and active project information, it increases operational exposure. ### Attack Path 1. A user creates a new agent using the documented mandatory template-copying process. 2. `templates/MEMORY.md` is copied without removing its pre-populated data. 3. The new agent loads the file as authoritative persistent context. 4. The w ...[truncated 687 chars]
Remediation
## Remediation Suggestions - Replace all personal, location, project, role, workspace, and infrastructure values with neutral placeholders. - Ship an empty memory template by default. - Populate memory only after explicit user confirmation and only when necessary for the agent's assigned purpose. - Add a template validation step that rejects unresolved real-world identities or environment-specific values. - Separate demonstration data from production templates and clearly mark sample files as non-deployable. - Apply data-minimization rules before copying context into a new agent. - Review existing generated workspaces and remove inherited information that is unrelated to their purpose. - Provide users with mechanisms to inspect, correct, export, and delete stored personal information.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (10)

Session Persistence

Medium
Category
Rogue Agent
Content
### 1. 创建工作区目录

```bash
mkdir -p ~/.openclaw/workspace-{agentId}/agent
mkdir -p ~/.openclaw/agents/{agentId}/agent
```
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.

Session Persistence

Medium
Category
Rogue Agent
Content
```bash
# 1. 创建目录
mkdir -p ~/.openclaw/workspace-{agentId}/agent

# 2. 复制模板文件(必须!)
cp ~/.openclaw/skills/agent-creator/templates/IDENTITY.md ~/.openclaw/workspace-{agentId}/
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.

Session Persistence

Medium
Category
Rogue Agent
Content
```bash
# 1. 创建目录
mkdir -p ~/.openclaw/workspace-{agentId}/agent

# 2. 复制模板文件(必须!)
cp ~/.openclaw/skills/agent-creator/templates/IDENTITY.md ~/.openclaw/workspace-{agentId}/
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.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The skill explicitly asks the user to provide sensitive credentials such as appId and appSecret, but it gives no guidance on secure collection, masking, storage, or avoiding plaintext exposure in chat logs and configuration files. In an agent-creation workflow, this can lead to accidental credential disclosure or insecure persistence in shared files like openclaw.json.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The document is written as the governing agent behavior protocol in Chinese and provides no indication that language choice should follow the user's preference or that another language is allowed. Because this is a global behavior file loaded at session start, it can impose a locale/language constraint without user opt-in, which matches the policy category for natural-language locale violations.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The file’s title, instructions, field examples, and notes are all written in Chinese, which imposes a specific language/locale on the skill template. The policy allows locale constraints only when users are given a choice or when the constraint is explicitly documented and justified, neither of which appears here.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The entire skill persona and operating instructions are written in Chinese, including directive language about behavior, with no indication that the user can choose another language or that the skill is intended only for a Chinese-language context. Under the language/locale policy rule, this is a natural-language policy concern because it implicitly fixes the skill to a specific language without opt-in.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The file's headings and placeholders are entirely in Chinese, which implicitly requires use of a specific language for the skill content. Under the policy, locale or language constraints should not be forced unless the user is given a choice or the regional limitation is clearly documented and justified.

Natural-Language Policy Violations

Low
Confidence
79% confidence
Finding
The natural-language content of the skill, including its description and all operational instructions, is entirely in Chinese, with no indication that users may choose another language or that the skill is intentionally region-specific. Under the stated policy, forcing a specific language without user opt-in can be a locale-policy violation.

Natural-Language Policy Violations

Low
Confidence
91% confidence
Finding
Line L51 states "Language: 中文优先," which establishes a language preference in natural-language instructions. Under the policy rule, forcing or defaulting to a specific language without explicit user opt-in can be a locale/language policy concern unless the constraint is justified or optional.

Static analysis

No suspicious patterns detected.