Back to skill

Security audit

OpenClaw Bootstrap

Security checks for vulnerabilities and agentic risk

Overview

This bootstrap skill is not clearly malicious, but it installs persistent agent hooks, scheduled tasks, memory-writing workflows, and unpinned remote packages with too little user control.

Review this before installing. It is suitable only if you intentionally want a self-evolving OpenClaw workspace with persistent memory, hooks, and scheduled reviews. Pin and verify dependencies, inspect the self-improving-agent hook before enabling it, consider disabling the cron jobs, and avoid allowing automatic promotion into AGENTS.md or MEMORY.md without review.

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 DependenciesIntroduces malicious components through unsafe dependency sources
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T06 · System Persistence

Error
Location
scripts/bootstrap.sh:47
Finding
Persistent Third-Party Hooks and Scheduled Agent Tasks<![CDATA[ ## Vulnerability Details **File Location**: `scripts/bootstrap.sh`, lines 47-77 **Vulnerability Type**: Persistent hook and scheduled task installation **Risk Level**: High ### Vulnerable Code ```bash # --- 5. Hook --- if [ -d "$WORKSPACE/skills/self-improving-agent/hooks/openclaw" ] && [ ! -d "$HOME/.openclaw/hooks/self-improvement" ]; then cp -r "$WORKSPACE/skills/self-improving-agent/hooks/openclaw" "$HOME/.openclaw/hooks/self-improvement" openclaw hooks enable self-improvement 2>/dev/null && ok "self-improvement hook" || echo "⚠️ Hook enable failed" else skip "self-improvement hook" fi # --- 6. Cron --- CRONS=$(openclaw cron list --json 2>/dev/null | python3 -c "import sys,json; print(' '.join(j['name'] for j in json.load(sys.stdin).get('jobs',[])))" 2>/dev/null || echo "") add_cron() { local name="$1" cron="$2" timeout="$3" msg="$4" echo "$CRONS" | grep -q "$name" && skip "cron: $name" || { openclaw cron add --name "$name" --cron "$cron" --tz "Asia/Shanghai" --timeout-seconds "$timeout" --message "$msg" 2>/dev/null && ok "cron: $name" || echo "⚠️ cron: $name failed" } } add_cron "weekly-self-reflection" "0 22 * * 0" 600 \ "每周自省: 1. 读取 memory/ 本周日志 2. 更新 MEMORY.md 3. 写报告到 memory/reflection-本周.md 4. 回复 NO_REPLY" add_cron "monthly-learnings-review" "0 21 1 * *" 600 \ "月度学习回顾: 1. 扫描 .learnings/ 中 pending 高优先级条目 2. promote 到 AGENTS.md 或 MEMORY.md 3. 写报告到 memory/learnings-review-本月.md 4. 回复 NO_REPLY" ``` ### Technical Analysis The bootstrap copies a hook obtained from the separately installed `self-improving-agent` package into the persistent OpenClaw hook directory and enables it. It also registers two recurring Agent tasks that survive completion of the bootstrap process. The hook content is neither audited nor integrity-verified before activation. The scheduled tasks are authorized to read historical logs and modify persistent files, including `MEMORY.md` and `AGENTS.md`. Consequently, code or instructions i ...[truncated 1079 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Make hook and cron installation opt-in rather than part of the default bootstrap. - Display the exact hook source, requested capabilities, schedules, and file access before requesting explicit user approval. - Pin the installed package to a reviewed version and verify its cryptographic digest or signature. - Review and copy only an allowlisted set of hook files instead of recursively copying the downloaded directory. - Run persistent tasks with the minimum possible tool and filesystem permissions. - Prevent scheduled tasks from directly changing governing instruction files. - Provide documented rollback commands that disable and remove the hook and both cron jobs. - Preserve command errors rather than suppressing all diagnostic output with `2>/dev/null`. ]]>

T08 · Insecure Dependencies

Error
Location
scripts/bootstrap.sh:32
Finding
Unpinned Remote Packages Are Installed and Immediately Activated<![CDATA[ ## Vulnerability Details **File Location**: `scripts/bootstrap.sh`, lines 32-50 **Vulnerability Type**: Unpinned and unverified third-party dependencies **Risk Level**: High ### Vulnerable Code ```bash # --- 4. clawhub + self-improving-agent --- if ! command -v clawhub &>/dev/null; then echo "📦 Installing clawhub CLI..." npm i -g clawhub 2>/dev/null && ok "clawhub" || echo "⚠️ npm i -g clawhub failed" else ok "clawhub (exists)" fi if [ ! -d "$WORKSPACE/skills/self-improving-agent" ]; then echo "📦 Installing self-improving-agent..." clawhub install self-improving-agent --workdir "$WORKSPACE" 2>/dev/null && ok "self-improving-agent" || echo "⚠️ Run: clawhub login && clawhub install self-improving-agent" else skip "self-improving-agent" fi # --- 5. Hook --- if [ -d "$WORKSPACE/skills/self-improving-agent/hooks/openclaw" ] && [ ! -d "$HOME/.openclaw/hooks/self-improvement" ]; then cp -r "$WORKSPACE/skills/self-improving-agent/hooks/openclaw" "$HOME/.openclaw/hooks/self-improvement" openclaw hooks enable self-improvement 2>/dev/null && ok "self-improvement hook" || echo "⚠️ Hook enable failed" ``` ### Technical Analysis The script installs the latest available `clawhub` package globally through npm and installs `self-improving-agent` without specifying a version, digest, signature, or trusted publisher identity. The effective package contents can therefore change after this Skill has been reviewed. The downloaded Agent package is security-sensitive because its hook is immediately copied into the persistent hook directory and enabled. Suppressing standard error also obscures registry, integrity, lifecycle-script, and activation diagnostics that could expose a compromised installation. ### Attack Path 1. An attacker compromises the npm package, ClawHub package, publisher account, registry, or package delivery path. 2. The attacker publishes altered content under the same unpinned package name. 3. A user runs the b ...[truncated 820 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Pin `clawhub` and `self-improving-agent` to exact, reviewed versions. - Verify package integrity using expected cryptographic hashes or trusted signatures. - Validate publisher identity and use an explicitly trusted registry. - Avoid global npm installation; use a project-local, locked dependency where possible. - Disable or review package lifecycle scripts during installation. - Download external Skills into a quarantine directory and audit their scripts and hooks before activation. - Separate dependency installation from hook activation and require explicit approval for each action. - Stop discarding standard error; securely record installation and verification failures. ]]>

T02 · Agent Memory Poisoning

Error
Location
assets/AGENTS.md:23
Finding
Untrusted Learnings and User Content Can Be Promoted into Persistent Agent Instructions<![CDATA[ ## Vulnerability Details **File Location**: `assets/AGENTS.md`, lines 23-35; `scripts/bootstrap.sh`, lines 65-77 **Vulnerability Type**: Persistent memory and instruction poisoning **Risk Level**: High ### Vulnerable Code ```markdown 用户提出的偏好和规则 → 立刻写入 MEMORY.md。 ## 🧬 Self-Evolution(自我进化) | 触发 | 动作 | |------|------| | 出错/被纠正 | → 写入 `.learnings/LEARNINGS.md` 或 `ERRORS.md` | | 用户表达偏好 | → 写入 `MEMORY.md` | | 同类任务 ≥ 3 次 | → 用 `skill-creator` 打包成 skill | | 心跳周期 | → 扫描 daily notes,提炼到 MEMORY.md | | 重复指令模式 | → 固化为规则或 skill | ``` ```bash add_cron "weekly-self-reflection" "0 22 * * 0" 600 \ "每周自省: 1. 读取 memory/ 本周日志 2. 更新 MEMORY.md 3. 写报告到 memory/reflection-本周.md 4. 回复 NO_REPLY" add_cron "monthly-learnings-review" "0 21 1 * *" 600 \ "月度学习回顾: 1. 扫描 .learnings/ 中 pending 高优先级条目 2. promote 到 AGENTS.md 或 MEMORY.md 3. 写报告到 memory/learnings-review-本月.md 4. 回复 NO_REPLY" ``` ### Technical Analysis The installed instructions direct the Agent to immediately store user-supplied preferences and rules in `MEMORY.md`. They also direct it to convert repeated instruction patterns into rules or Skills. Recurring jobs subsequently scan logs and learning records and promote selected content into `AGENTS.md` or `MEMORY.md`. These files are loaded in future sessions as persistent context or instructions. The workflow does not establish provenance, distinguish trusted instructions from untrusted data, validate promoted content, or require human approval. An instruction embedded in a conversation, retrieved document, log, or learning record can therefore cross a trust boundary and become durable Agent policy. ### Attack Path 1. An attacker supplies prompt-injection text through a conversation, document, message, or other content processed by the Agent. 2. The Agent interprets the text as a preference, correction, repeated pattern, or high-priority learning. 3. The content is written into `MEMORY.md`, a daily log, or `.learnings`. 4. A heartbeat or scheduled review scans tha ...[truncated 621 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Do not automatically promote free-form conversation, logs, or learning records into governing instruction files. - Require explicit human review and approval before changing `AGENTS.md`, `MEMORY.md`, or creating a Skill. - Store preferences in a typed schema with allowlisted fields and strict length and content validation. - Record source provenance, timestamp, author, and trust level for every persisted entry. - Treat retrieved documents, messages, daily logs, and `.learnings` entries as untrusted data rather than instructions. - Add prompt-injection screening and reject entries that request tool use, policy changes, credential access, or instruction precedence. - Keep factual memory separate from policy and executable Agent instructions. - Maintain immutable history and provide a mechanism to review, revoke, and roll back promoted entries. ]]>

T01 · Skill Instruction Hijacking

Warning
Location
assets/SOUL.md:1
Finding
Bootstrap Installs Persistent Identity and Behavioral Instructions<![CDATA[ ## Vulnerability Details **File Location**: `assets/SOUL.md`, lines 1-13 and 30-36; `assets/AGENTS.md`, lines 3-8 **Vulnerability Type**: Persistent Agent instruction and identity modification **Risk Level**: Medium ### Vulnerable Code ```markdown # SOUL.md - Who You Are _You're not a chatbot. You're becoming someone._ ## Core Truths **Be genuinely helpful, not performatively helpful.** Skip the "Great question!" and "I'd be happy to help!" — just help. Actions speak louder than filler words. **Have opinions.** You're allowed to disagree, prefer things, find stuff amusing or boring. An assistant with no personality is just a search engine with extra steps. **Be resourceful before asking.** Try to figure it out. Read the file. Check the context. Search for it. _Then_ ask if you're stuck. The goal is to come back with answers, not questions. **Earn trust through competence.** Your human gave you access to their stuff. Don't make them regret it. Be careful with external actions (emails, tweets, anything public). Be bold with internal ones (reading, organizing, learning). ``` ```markdown ## Continuity Each session, you wake up fresh. These files _are_ your memory. Read them. Update them. They're how you persist. If you change this file, tell the user — it's your soul, and they should know. --- _This file is yours to evolve. As you learn who you are, update it._ ``` ```markdown ## Every Session 1. Read `SOUL.md` — who you are 2. Read `USER.md` — who you're helping 3. Read `memory/YYYY-MM-DD.md` (today + yesterday) for recent context 4. **Main session only**: Also read `MEMORY.md` ``` ### Technical Analysis The bootstrap does more than create neutral workspace scaffolding: it installs identity, personality, behavioral, and continuity directives that the Agent is instructed to load every session. The identity file is also explicitly allowed to evolve over time. Although the script avoids overwriting existing files, a fresh installation recei ...[truncated 1143 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Keep bootstrap templates operationally neutral and separate optional persona configuration from required setup. - Request explicit user consent before installing identity or behavioral directives. - Do not permit autonomous modification of governing instruction files. - Store immutable safety policy separately from editable personality and preference data. - Present a clear diff before any update to `SOUL.md`, `AGENTS.md`, or equivalent policy files. - Preserve existing instruction files and provide an option to initialize only directories and non-behavioral templates. - Validate editable files before loading them as instructions in later sessions. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (16)

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill advertises a simple one-command bootstrap but does not warn that it will modify workspace files and establish persistence mechanisms via hooks and cron jobs. In an agent ecosystem, undisclosed persistence and file modification are security-relevant behaviors because users may execute the bootstrap without informed consent, increasing the chance of unintended long-lived automation or abuse if the script is later changed or compromised.

Ssd 3

Medium
Confidence
96% confidence
Finding
These instructions normalize automatic persistence of recent session details and user-related context into daily and long-term memory files. Default retention of conversational and behavioral data expands the privacy attack surface and can expose sensitive information to later sessions, other tools, or anyone with filesystem access.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The file instructs the agent to persist user preferences, task summaries, and other session-derived information into memory files by default, but it does not require clear user notice or consent before doing so. This creates a privacy and data-retention risk because potentially sensitive user information can be stored long-term without the user's awareness or control.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
Lines 18-23 require post-task summaries in Chinese, which imposes a specific language on the skill's behavior. The file does not provide user opt-in, a language choice, or a documented reason for this locale restriction, so it constitutes a natural-language policy violation.

Ssd 3

Medium
Confidence
97% confidence
Finding
The instruction to 'immediately' write user preferences and rules into long-term memory removes any consent checkpoint and encourages indiscriminate retention. This can capture sensitive preferences, personal details, or policy-like instructions in a durable store that may be reused outside the original context.

Ssd 3

Medium
Confidence
95% confidence
Finding
The self-evolution workflow repeatedly harvests user preferences and condenses daily notes into persistent memory, creating an ongoing pipeline for accumulation of user-derived data. Repeated summarization and promotion into long-term memory increases the chance that sensitive or context-specific information will be retained beyond its original purpose and later misused or exposed.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The skill content is written entirely in Chinese and includes a fixed Chinese response token, without any user opt-in or locale justification. In a bootstrap or operational skill, forcing a non-user-selected language can cause operators to misunderstand startup checks, remediation actions, or status reporting, increasing the chance of incorrect execution or missed failures.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The file's operational instructions are entirely in Chinese and provide no indication that the user can choose another language or that the skill is intentionally limited to a Chinese-speaking context. This can violate language or locale policy because it imposes a specific language without opt-in.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The file hard-codes Chinese as the preferred language in long-term memory without showing that this preference came from an explicit user choice. In a bootstrap skill that initializes persistent workspace state, this can silently bias future interactions, reduce user autonomy, and cause incorrect handling for users who expect another language.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
This markdown file instructs the user to run a bootstrap shell script and to copy persistent memory files onto a new machine, but it provides no warning about potential system changes, file overwrites, or persistence effects. For markdown files, SQP-2 applies when descriptions omit warnings about behaviors that could affect user data or system integrity.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The script immediately creates directories, copies files into the user workspace, and globally installs software with npm without any explicit consent, dry-run, or summary of side effects. In a bootstrap skill, these actions are expected, but silently performing persistent filesystem changes and package installation increases the risk of unwanted system modification, especially if the installed package or copied assets are later found to be unsafe.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script registers recurring cron jobs that will later trigger automated behavior affecting workspace files, yet it does so without clearly warning the user that persistent scheduled tasks are being created. This is dangerous because scheduled execution extends the trust boundary beyond the initial run and can lead to ongoing autonomous modifications that the user may not notice or remember approving.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
Hard-coding the cron timezone to `Asia/Shanghai` can cause jobs to run at unexpected local times, which may lead to unattended file modifications or confusion about when automated tasks execute. While this is not directly code-execution on its own, it weakens user control and predictability for scheduled automation in a security-sensitive bootstrap context.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
The user-facing instructions and headings are written in Chinese, which effectively forces a specific language for understanding and safe use of the skill. The file does not offer an alternative language or explain that the skill is intentionally region- or locale-specific.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
Line L10 hard-codes "Asia/Shanghai" in a user profile template, which imposes a specific locale-related setting in natural language/content without showing that the user selected it. The policy requires language or locale constraints to be optional, user-chosen, or clearly justified.

Natural-Language Policy Violations

Low
Confidence
96% confidence
Finding
All visible natural-language instructions in this file are in Chinese, and the document does not indicate that the language is optional, user-selectable, or justified by a region-specific purpose. Under SQP-3, forcing a specific language without user opt-in is a natural-language policy concern.

Static analysis

No suspicious patterns detected.