Back to skill

Security audit

Self Evolution Cn

Security checks for vulnerabilities and agentic risk

Overview

The skill is purpose-aligned but installs persistent hooks and a daily job that can automatically save conversation/tool data and modify agent instructions without enough user control.

Install only if you intentionally want automatic cross-session learning, shared agent logs, bootstrap reminders, and daily modification of SOUL.md. Review or disable cron and AUTO_PROMOTE_ENABLED first, avoid running setup as root, use isolated per-project learning directories, and do not use it where prompts, tool output, secrets, or proprietary context may be captured.

Vulnerability Patterns
  • 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
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T02 · Agent Memory Poisoning

Error
Location
scripts/daily_review.sh:163
Finding

Unreviewed Learning Records Are Automatically Promoted into Persistent Agent Instructions

Content
View full analysis
/dev/null || true) if [ -z "$candidates" ]; then return 0 fi ``` After identifying a file containing at least one candidate, the script extracts every Pattern-Key from that file: ```bash for file in $candidates; do local pattern_keys=$(awk '/^## \[/ { in_record = 1 } in_record && /- Pattern-Key: / { match($0, /- Pattern-Key: [^$]*/) key = substr($0, RSTART + 15, RLENGTH - 15) print key in_record = 0 } /^---/ { in_record = 0 }' "$file" | sort -u) ``` The generated rule is then written directly into the persistent agent configuration: ```bash else # No matching section exists, so create it echo "" >> "$soul_file" echo "$section_header" >> "$soul_file" echo "$rule_content" >> "$soul_file" fi ``` ### Technical Analysis The daily review process treats writable learning records as trusted sources for persistent agent instructions. When recurrence data reaches the configured threshold, the script extracts a record's summary and suggested action and inserts them into the target agent's `SOUL.md`. There is no human approval, provenance verification, content validation, safety-policy filtering, or distinction between informational observations and executable behavioral instructions. The default configuration also enables automatic promotion: ```bash AUTO_PROMOTE_ENABLED="${AUTO_PROMOTE_ENABLED:-true}" ``` The candidate-selection logic has an additional scope flaw. `grep -l` returns an ent ...[truncated 1975 chars]
Remediation
View remediation

T01 · Skill Instruction Hijacking

Error
Location
hooks/openclaw/handler.js:357
Finding

Hook Injects Behavioral Instructions into Every Agent Bootstrap Context

Content
View full analysis
Remediation
View remediation

T06 · System Persistence

Error
Location
scripts/setup.sh:180
Finding

One-Click Setup Installs a Persistent Scheduled Task Without Explicit Opt-In

Content
View full analysis
> $LOG_FILE 2>&1" # Remove old cron tasks crontab -l 2>/dev/null | grep -v "trigger-daily-review.sh" | crontab - log_info " Removed old cron task" # Add the new cron task (crontab -l 2>/dev/null; echo "$CRON_JOB") | crontab - log_info "Cron task added" ``` The persistence mechanism is also documented in `SKILL.md:32-37` and `references/multi-agent.md:53-59`. ### Technical Analysis The advertised one-click setup automatically changes the invoking account's crontab. The task survives the setup process and executes the Skill every day at midnight. Periodic review is related to an optional automation feature, but scheduled execution is not required for the core function of recording learning events. The installer does not ask for explicit consent, show the exact change for confirmation, provide an installation flag, or create a corresponding uninstall operation. The cleanup command is also overly broad: ```bash grep -v "trigger-daily-review.sh" ``` It removes every existing cron line containing that filename, rather than only the exact entry installed by this Skill. An unrelated task using a script with the same name can therefore be deleted. The project defaults to paths under `/root/.openclaw`. If setup is run as root, the scheduled task executes with root privileges and can modify root-owned OpenClaw state every day. ### Attack Path 1. A user follows the documented one-click setup procedure. 2. `setup.sh` modifies the current account's crontab without a separate opt-in decision. 3. Existing cron entries containing `trigger-daily-review.sh` are removed. 4. A new daily task is installed. 5. At midni ...[truncated 686 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/daily_review.sh:348
Finding

Predictable Temporary File Enables Symlink-Based Arbitrary File Overwrite

Content
View full analysis
/tmp/rule_content.txt awk -v section="$section_header" ' BEGIN { in_section = 0; found = 0 } /^## / { if (in_section) { # Insert content before the next second-level heading while ((getline line < "/tmp/rule_content.txt") > 0) { print line } close("/tmp/rule_content.txt") print $0 exit } if ($0 == section) { in_section = 1 } } { print } END { if (in_section) { # Append content when there is no following second-level heading while ((getline line < "/tmp/rule_content.txt") > 0) { print line } close("/tmp/rule_content.txt") } } ' "$soul_file" > "$soul_file.tmp" && mv "$soul_file.tmp" "$soul_file" rm -f /tmp/rule_content.txt ``` ### Technical Analysis The scheduled script uses a fixed filename in the globally writable `/tmp` directory. Shell redirection follows symbolic links. A local attacker can create `/tmp/rule_content.txt` as a symbolic link to another file before the scheduled job runs. When this statement executes: ```bash echo "$rule_content" > /tmp/rule_content.txt ``` the shell opens the symlink target with truncation. The target is overwritten using the privileges of the cron owner. No exclusive file creation, ownership verification, private temporary directory, or restrictive file mode is used. The later `rm` call removes the symbolic link rather than repairing the overwritten target. Concurrent executions can also overwrite or delete each other's temporary data. ### Attack Path 1. The attacker has local access sufficient to create entries in `/tmp`. 2. The attacker predicts the fixed pathname `/tmp/rule_content.txt`. 3. Before the daily cron exec ...[truncated 958 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (64)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the underlying code is primarily scaffolding or template generation rather than a true evolution system, the mismatch is still security-relevant because users may authorize intrusive setup expecting different functionality. The danger here is deceptive capability framing, not necessarily direct exploit logic.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the underlying code is primarily scaffolding or template generation rather than a true evolution system, the mismatch is still security-relevant because users may authorize intrusive setup expecting different functionality. The danger here is deceptive capability framing, not necessarily direct exploit logic.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the underlying code is primarily scaffolding or template generation rather than a true evolution system, the mismatch is still security-relevant because users may authorize intrusive setup expecting different functionality. The danger here is deceptive capability framing, not necessarily direct exploit logic.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

If the underlying code is primarily scaffolding or template generation rather than a true evolution system, the mismatch is still security-relevant because users may authorize intrusive setup expecting different functionality. The danger here is deceptive capability framing, not necessarily direct exploit logic.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

If the underlying code is primarily scaffolding or template generation rather than a true evolution system, the mismatch is still security-relevant because users may authorize intrusive setup expecting different functionality. The danger here is deceptive capability framing, not necessarily direct exploit logic.

Content

No source excerpt is available for this finding.

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

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

ort SHARED_LEARNING_DIR="/root/.openclaw/shared-learning" export SHARED_AGENTS="agent1 agent2"

创建目录和软链接

mkdir -p "$SHARED_LEARNING_DIR" cp .learnings/*.md "$SHARED_LEARNING_DIR/" ln -s "$SHARED_LEARNING_DIR" ~/.openclaw/workspace-agent1/.learnings ln -s "$SHARED_LEARNING_DIR" ~/.openclaw/workspace-agent2/.learnings

启用 hook 和 cron

openclaw hooks enable self-evolution-cn crontab -e # 添加:0 0 * * * ~/.openclaw/skills/self-evolution-cn/scripts/trigger-daily-review.sh >> ~/.openclaw/skills/self-evolution-cn/logs/heartbeat-daily.log 2>&1

text

## 脚本说明

| 脚本 | 功能 |
|------|------|
| `setup.sh` | 一键配置 |
| `daily_review.sh` | 自动统计与提升(每日 00:00 执行) |
| `trigger-daily-review.sh` | Cron 触发脚本 |
| `activator.sh` | 任务完成后提醒 |
| `error-detector.sh` | 命令失败时提醒 |
| `extract-skill.sh` | 提取可重用技能 |

## Hook 集成

自动识别并记录:
- **用户纠正**:检测中文关键

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The hook advertises automatic recording of learnings, errors, and requirements but does not provide a clear warning that user messages and tool outputs may be persisted to files, including shared directories. This omission undermines informed consent and increases the chance that secrets, personal data, or proprietary context are silently retained.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The injected bootstrap reminder instructs the agent to automatically record conversation-derived content into learning files, normalizing persistent retention of user data. Because this instruction is injected at bootstrap, it can systematically influence downstream agent behavior to copy sensitive content into storage beyond the original interaction boundary.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The reminder explicitly mandates keeping complete context and full error content in records, which strongly increases the chance of capturing secrets, PII, proprietary source snippets, and operational details. In an agent system, such broad logging guidance is dangerous because it promotes over-collection and long-lived storage of sensitive data.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The script uses a fixed world-writable temporary path (/tmp/rule_content.txt) and later removes it. An attacker on the same system could pre-create or race this path as a symlink or regular file, causing unintended overwrite/read behavior during the awk insertion flow or deletion of an attacker-chosen target if additional unsafe conditions exist. In a root-executed scheduled script, predictable /tmp filenames are especially risky.

Content

Scanner excerpt · scripts/daily_review.sh (reported line 376)May include surrounding context.

sh
}
            }
            ' "$soul_file" > "$soul_file.tmp" && mv "$soul_file.tmp" "$soul_file"
            rm -f /tmp/rule_content.txt
        else
            # 没有找到二级标题,创建新的
            echo "" >> "$soul_file"

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill documents shell-based setup, hooks, cron, environment-variable configuration, and filesystem operations, but the manifest does not declare any tool scope such as permissions or allowed-tools. This weakens operator visibility and policy enforcement, making it easier for a seemingly simple skill to gain execution and persistence-related capabilities without explicit consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The skill is named and positioned as self-evolution-cn, and the hook logic emphasizes Chinese keyword detection while framing the skill as a general self-evolution system. Although some English keywords are included, the file does not clearly offer users a language/locale choice or explain a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill advertises automatic recording of user messages and tool outputs but does not present an explicit privacy warning, retention notice, or data-sharing warning. Because data is written to shared learning logs across agents, users may unknowingly expose sensitive prompts, secrets, or command output beyond the originating session.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs automatic recording of user messages and tool outputs into shared logs across agents, creating a clear data exfiltration and oversharing risk within the local environment. In context, this is more dangerous because the recorded material may include credentials, proprietary prompts, file contents, command errors, and other sensitive operational data that become accessible to multiple agents or sessions.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
89% confidence
Finding

Creating a shared directory and symlinking it into multiple agent workspaces establishes durable cross-session state and cross-agent data access. In this context, persistence is more dangerous because it normalizes ongoing sharing of potentially sensitive learning/error logs between otherwise separate agent environments.

Content

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

md
export SHARED_AGENTS="agent1 agent2"

# 创建目录和软链接
mkdir -p "$SHARED_LEARNING_DIR"
cp .learnings/*.md "$SHARED_LEARNING_DIR/"
ln -s "$SHARED_LEARNING_DIR" ~/.openclaw/workspace-agent1/.learnings
ln -s "$SHARED_LEARNING_DIR" ~/.openclaw/workspace-agent2/.learnings

Session Persistence

Medium
Category
Rogue Agent
Confidence
93% confidence
Finding

The cron instruction establishes recurring execution, giving the skill persistence across sessions and tasks. Persistence is not always malicious, but when combined with hook-based data collection and shared-log writing it increases blast radius by enabling unattended ongoing processing and retention.

Content

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

启用 hook 和 cron

openclaw hooks enable self-evolution-cn crontab -e # 添加:0 0 * * * ~/.openclaw/skills/self-evolution-cn/scripts/trigger-daily-review.sh >> ~/.openclaw/skills/self-evolution-cn/logs/heartbeat-daily.log 2>&1

text

## 脚本说明

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger keywords are broad conversational phrases like 'Actually', 'should be', or generic correction/error phrases, which can match normal user dialogue and tool output. This can cause unintended capture and storage of benign conversations, increasing privacy risk and poisoning shared logs with inaccurate entries.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documented hooks read from user-content and tool-output fields and persist entries into record files, which creates systematic collection of conversational and execution data. This is especially risky in a multi-agent shared directory because one agent's sensitive context can be silently exposed to others and retained beyond the original task.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The entire template, including headings, instructions, examples, and description guidance, is written in Chinese with no indication that language selection is optional. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation unless it is clearly documented as region-specific or offers a choice.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The knowledge-gap triggers are broad natural-language phrases that can match ordinary conversation and cause automatic persistence of user content without deliberate consent. In this skill, that unintended recording is security-relevant because the captured content is later written to shared learning files, increasing privacy and data-retention risk.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The best-practice phrases are generic feedback terms that are likely to appear in normal dialogue, so the hook may log messages users did not intend to store. Because the skill promotes these records into persistent shared files and eventually SOUL.md, accidental capture can propagate sensitive or irrelevant content across agents.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly instructs storing complete conversational context in LEARNINGS.md, which creates a direct risk of retaining secrets, personal data, and sensitive business information in plaintext. Since the hook can trigger automatically from common phrases, the chance of involuntary capture is significant.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Persisting command inputs, parameters, and tool outputs in error logs can capture credentials, file contents, tokens, paths, and other sensitive execution data. Because these logs are designed for reproducibility and troubleshooting, they may preserve exactly the material an attacker or unauthorized agent would find useful.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file specifies fixed automatic reply messages only in Chinese, such as “已记录到 LEARNINGS.md”, and the skill name/description indicate a Chinese-localized hook. There is no user opt-in, alternative locale handling, or documented justification that this hook is intentionally limited to Chinese-language contexts.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

A shared learning directory across all agents increases cross-context exposure by allowing records derived from one agent's conversations or tool activity to be visible to others. In a multi-agent environment, this breaks isolation expectations and can spread sensitive data beyond its original task boundary.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.