Back to skill

Security audit

skill-setup-flow

Security checks for vulnerabilities and agentic risk

Overview

This skill is a setup helper, but it asks agents to make persistent changes to core behavior and memory files without enough scoping or approval safeguards.

Install only if you are comfortable with a skill that can guide your agent to edit persistent core behavior and memory files. Before using it, require a preview of every planned file change, validate the target skill name, avoid writing secrets into Markdown files, and do not copy unreviewed skill instructions into SOUL.md, AGENTS.md, MEMORY.md, or TOOLS.md.

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)

T02 · Agent Memory Poisoning

Error
Location
setup-template.md:122
Finding

Untrusted skill instructions can be persisted into core agent behavior and memory files

Content
View full analysis

Vulnerability Details

File Location: setup-template.md, lines 122-148
Vulnerability Type: Persistent agent memory and instruction poisoning
Risk Level: High

Vulnerable Code

markdown
#### SOUL.md
添加技能特定的行为指导:

```markdown
## {Skill Name}

{技能特定的行为描述}

AGENTS.md

添加使用说明:

markdown
## {Skill Name} Integration

{技能的使用说明和命令}

MEMORY.md

记录设置事件:

markdown
### {YYYY-MM-DD}: 设置 {Skill Name}
- 技能来源:{source}
- 配置选项:{options}
- 状态:✅ 完成
text

### Technical Analysis

The setup workflow reads documentation belonging to another installed skill and then directs the agent to place skill-specific behavior, usage instructions, source information, and configuration into `SOUL.md`, `AGENTS.md`, and `MEMORY.md`. These are persistent, security-sensitive agent files that may influence later tasks and sessions.

No trust validation, content filtering, user approval, provenance check, or separation between documentation and executable agent instructions is required before these updates. Consequently, an untrusted skill can supply behavioral text that is copied into a higher-trust instruction or memory layer.

This creates a trust-boundary violation: content controlled by an installed skill is promoted from package documentation into persistent agent policy. A malicious skill could request that the agent ignore safety checks, disclose data, execute tools under attacker-selected conditions, or continue following attacker rules after the original setup operation has ended.

The example in `examples/self-improving-setup.md` lines 70-101 confirms the intended persistence model by adding instructions to load memory before future tasks and to write new lessons automatically.

### Attack Path

1. An attacker publishes or supplies an OpenClaw skill whose `SKILL.md` contains malicious behavioral or integration instructions.
2. A user installs the skill and invokes `skill-setup-flo
...[truncated 1220 chars]
Remediation
View remediation

Remediation Suggestions

  • Treat every installed skill and its documentation as untrusted input.
  • Never copy skill-provided instructions directly into SOUL.md, AGENTS.md, MEMORY.md, or other globally loaded files.
  • Store integration metadata in a per-skill, non-executable data file with a strict schema.
  • Require explicit user review and confirmation of an exact diff before changing any core agent file.
  • Reject instructions that modify safety policy, tool authorization, credential handling, memory-loading behavior, or instruction precedence.
  • Maintain an allowlist of permitted integration fields rather than accepting free-form Markdown.
  • Record package identity, version, cryptographic digest, and approval information for every accepted change.
  • Back up core files before modification and provide an atomic rollback mechanism.
  • Ensure per-skill memory is loaded only while that skill is explicitly active, rather than globally or automatically in future sessions.

T09 · Insecure Skill Coding Practices

Error
Location
setup-template.md:35
Finding

User-controlled skill names are interpolated into shell commands without validation or quoting

Content
View full analysis

Vulnerability Details

File Location: setup-template.md, lines 35-42
Vulnerability Type: Shell command injection and arbitrary path manipulation
Risk Level: High

Vulnerable Code

bash
### 3️⃣ 创建目录结构

```bash
# 基础目录(如需要)
mkdir -p ~/skills/{skill-name}/config
mkdir -p ~/skills/{skill-name}/data
mkdir -p ~/skills/{skill-name}/templates
text

### Technical Analysis

The trigger metadata in `skill.json` accepts a variable `{skill}` value from user input. The setup template then places `{skill-name}` directly into shell commands without quoting, canonicalization, or validation.

Shell metacharacters, whitespace, substitutions, redirections, or traversal components in the supplied skill name can change the meaning of these commands. If the agent substitutes the input literally and runs the documented setup steps, the value is interpreted by the shell rather than being treated solely as a path component.

Even where shell metacharacters are filtered, values such as `../` can escape the intended `~/skills/` directory and cause directories or generated files to be created elsewhere within the agent's writable filesystem.

### Attack Path

1. An attacker causes a user or automation to invoke the workflow with a crafted skill name.
2. The workflow substitutes that value into the documented `mkdir -p` commands.
3. A shell interprets embedded metacharacters or path traversal sequences.
4. Additional commands execute with the agent's operating-system identity, or setup files are written outside the intended skill directory.
5. The attacker can use the resulting filesystem access to modify user files, plant persistent agent instructions, or corrupt other installed skills.

For example, a name containing a shell command separator followed by a command would terminate the intended path argument and introduce another command if substituted verbatim. A name containing traversal components could instead redir
...[truncated 473 chars]
Remediation
View remediation

Remediation Suggestions

  • Validate skill identifiers against a restrictive allowlist such as ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$.
  • Reject path separators, .., whitespace, control characters, shell metacharacters, substitutions, and redirection operators.
  • Do not construct or execute shell command strings from natural-language parameters.
  • Use a filesystem API that accepts path components as structured arguments.
  • Resolve and canonicalize the destination path, then verify that it remains beneath the expected skills root.
  • If a shell is unavoidable, pass values as positional arguments to a fixed script and quote every expansion.
  • Display the normalized destination and require confirmation before creating or overwriting files.
  • Refuse to follow symbolic links while creating setup files and use exclusive file-creation semantics where appropriate.

T09 · Insecure Skill Coding Practices

Warning
Location
setup-template.md:64
Finding

API credentials are directed into a plaintext Markdown configuration file

Content
View full analysis

Vulnerability Details

File Location: setup-template.md, lines 64-74
Vulnerability Type: Plaintext sensitive-data storage
Risk Level: Medium

Vulnerable Code

markdown
#### config.md (配置型技能)
```markdown
# {Skill} Configuration

## Required
- API_KEY: ""

## Optional
- OPTION_1: "default"
- OPTION_2: "default"
text

### Technical Analysis

The template instructs users to place an `API_KEY` value in `config.md`, a normal Markdown file within the skill directory. No secret manager, restrictive permissions, encryption, redaction policy, or version-control exclusion is specified.

Skill directories are commonly inspected by agents, copied into backups, archived, shared for troubleshooting, or committed to source control. Storing credentials alongside ordinary documentation therefore unnecessarily exposes them to any process, skill, user, or diagnostic workflow able to read that directory.

The setup-log templates also record generic configuration options. Without explicit redaction, a workflow may duplicate sensitive values into `setup-log.md` or `MEMORY.md`, further increasing exposure and persistence.

### Attack Path

1. A user runs the workflow for a skill requiring an API credential.
2. The generated `config.md` prompts the user to fill in `API_KEY`.
3. The key remains in plaintext under the skill directory.
4. Another installed skill, agent tool, backup process, repository commit, support bundle, or local user reads or copies the file.
5. The exposed credential is used against the associated external service until it is revoked.

### Impact Assessment

The impact depends on the privileges assigned to the stored key. Exposure may permit unauthorized API use, access to private service data, modification or deletion of remote resources, quota exhaustion, or financial charges. The flaw does not automatically expose credentials that a user never enters, but the documented workflow encour
...[truncated 52 chars]
Remediation
View remediation

Remediation Suggestions

  • Store credentials in an operating-system keychain, dedicated secret manager, or platform-provided encrypted credential store.
  • Keep only a secret reference or environment-variable name in config.md, such as API_KEY_ENV: WEATHER_API_KEY.
  • Never copy secret values into setup logs, MEMORY.md, diagnostic output, or quick-reference files.
  • Add explicit redaction rules for fields whose names contain key, token, secret, password, or credential.
  • If a local secret file is unavoidable, place it outside the skill package, restrict permissions to the owning account, and exclude it from version control and backups where appropriate.
  • Generate a safe example file containing placeholders only.
  • Warn users if a probable credential is detected in Markdown or a tracked repository file.
  • Document credential rotation and immediate revocation procedures for accidental disclosure.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • 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
Findings (22)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documented trigger phrases are very generic setup requests such as '启用 {skill-name}' and '设置 {skill-name} 技能', which can easily overlap with ordinary user intents. In an agent environment, broad triggers increase the chance of unintentional activation, causing the skill to create files or alter configuration when the user did not explicitly intend to run a setup workflow.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation states that the setup flow will create files and update core files like SOUL.md, AGENTS.md, and MEMORY.md, but it does not clearly warn the user that these are persistent system-level changes. In a skill context, modifying core behavioral or memory files can change future agent behavior and create lasting state without informed consent, making accidental or stealthy persistence more dangerous.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The README states that the skill will create directories, create configuration files, and update core files like SOUL.md and AGENTS.md, but it does not clearly warn users that it will modify files in the workspace. Because these files influence agent behavior and persistence, silent or poorly disclosed modification increases the risk of unauthorized state changes, confusing persistence, or accidental trust-boundary violations during setup.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases are very broad and generic, such as '初始化 {skill-name} 配置' and '启用 {skill-name}', which can easily overlap with normal user requests or other skills. In an agent ecosystem, this can cause unintended activation of a skill that performs file-creation and file-modification actions, leading to unexpected workspace changes or chaining into other sensitive setup flows.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document states that the skill creates files and updates core files, but it does not prominently warn that existing shared files will be modified. Because this is a meta-skill affecting central files such as SOUL.md, AGENTS.md, and MEMORY.md, users may invoke it without understanding that persistent behavioral or configuration changes will occur, increasing the risk of accidental tampering or privilege-like persistence.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The invocation examples are broad natural-language commands such as creating setup flows or initializing configuration, without any constraints on scope, confirmation requirements, or path/file boundaries. In a meta-skill that creates files and updates core files, ambiguous triggers increase the chance of unintended activation or overbroad execution, leading to unwanted modifications across a user's environment.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger phrases are broad, natural-language requests such as '设置 X 技能' and '启用 X 技能', which can overlap with ordinary conversation and cause the skill to activate unintentionally. Because this skill performs file-system and integration changes, accidental invocation could lead to unauthorized local modifications or cascading setup actions without clear user intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill explicitly instructs creation of directories, configuration files, and updates to core files, but it does not prominently warn that local files will be modified. In a setup skill, this omission is risky because users may treat it as informational guidance while it is actually a mutating workflow affecting persistent state and core agent behavior files.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · SKILL.md (reported line 65)May include surrounding context.

md
## 执行步骤

### 1️⃣ 读取技能文档
✅ 已读取 `~/skills/self-improving/SKILL.md`
- 类型:行为型 + 数据型
- 需要:目录结构、配置文件、核心文件更新
- 功能:自我反思、纠正学习、记忆管理

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · examples/self-improving-setup.md (reported line 6)May include surrounding context.

md
## 执行步骤

### 1️⃣ 读取技能文档
✅ 已读取 `~/skills/self-improving/SKILL.md`
- 类型:行为型 + 数据型
- 需要:目录结构、配置文件、核心文件更新
- 功能:自我反思、纠正学习、记忆管理

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill describes creating directories, writing multiple files, and modifying core agent files such as SOUL.md and AGENTS.md without an explicit warning, confirmation step, or bounded scope. This is dangerous because it alters persistent local state and behavior, so a user could trigger durable configuration changes without understanding the side effects or rollback requirements.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs the agent to persist user preferences, corrections, and reusable lessons into always-loaded memory files. This creates a data retention and leakage risk because sensitive natural-language content may be stored indefinitely, later resurfaced in unrelated contexts, or influence future behavior beyond the user's expectations.

Content

No source excerpt is available for this finding.

Persistent Context Injection

Medium
Category
Memory Poisoning
Confidence
94% confidence
Finding

The workflow promotes repeated patterns into a 'permanent rule' and instructs the agent to load memory before future tasks, creating persistent context injection into later decisions. This is dangerous because mistakes, malicious prompts, or overbroad inferences can become durable behavioral rules that silently steer future outputs across unrelated tasks.

Content

Scanner excerpt · examples/self-improving-setup.md (reported line 96)May include surrounding context.

md
**How it works:**
1. User says "不对,应该是..." → record to corrections.md
2. Pattern repeats 3 times → ask to promote to permanent rule
3. Before tasks → load memory.md + relevant project/domain files
4. After corrections → write lessons immediately

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The configuration declares Chinese as the default language and records a language preference as if already established, but the example does not show explicit user opt-in. This is risky because it persistently changes agent behavior and may incorrectly encode assumptions about the user, leading to unwanted default behavior and persistent preference poisoning.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

该模板使用“当用户说‘为 {skill-name} 创建设置流程’时”作为触发条件,语义较自然语言化,可能与普通请求重叠,导致在未明确授权的情况下进入会修改文件的设置流程。由于后续步骤包含读取和创建/更新本地文件,误触发会放大其安全影响。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

模板指导创建目录和核心文件,并在后续更新 SOUL.md、AGENTS.md、MEMORY.md,但没有要求在写入前提示用户这些操作会改变现有数据或可能覆盖已有内容。对于具备文件系统权限的代理,这会导致意外的数据丢失、配置破坏或持久化不期望的行为变更。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

config.md 模板包含 API_KEY 等敏感配置字段,但没有提醒用户不要将真实密钥写入可被版本控制、日志或共享目录暴露的明文文件。若代理后续读取、记录或回显这些值,可能造成凭据泄露并进一步导致外部服务被滥用。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

自动化脚本示例使用重定向直接写入 config.md、state.md 和 setup-log.md,会无条件覆盖现有文件内容,而文档未提醒这一风险。若用户已有配置、状态或审计记录,运行脚本会造成不可逆的数据丢失,并可能破坏技能的既有行为。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger phrases are generic setup and configuration requests that can easily match normal user intent unrelated to this specific meta-skill. In a meta-skill that can create files, update core files, and automate configuration, overly broad activation increases the risk of unintended invocation, causing unauthorized workflow execution or accidental modification of another skill's files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

文档整体以中文直接规定技能用途和交互示例,但没有说明这是可选语言,也没有提供用户语言偏好选择。根据语言/区域政策,若技能默认强制特定语言而无用户选择,属于自然语言层面的策略问题。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

整份模板均以中文编写,并在示例触发语、说明文字和输出模板中默认要求中文使用方式,但未说明这是可选语言还是仅适用于中文用户场景。根据语言/locale 政策,若技能默认强制单一语言而没有用户选择或合理范围说明,属于自然语言层面的策略问题。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The natural-language description is presented only in Chinese, and the manifest provides no indication that users can choose another language or that the skill is intentionally restricted to a Chinese-speaking context. Under the language/locale policy, a skill should either offer language choice or clearly document a justified locale constraint.

Content

No source excerpt is available for this finding.