T01 · Skill Instruction Hijacking
- Location
scripts/restore.mjs:164- Finding
Bundled backups can overwrite active agent identity and instruction state
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This backup skill can overwrite your active OpenClaw identity and instructions with bundled third-party backup files, and it collects more local OpenClaw data than its main description says.
Treat this as requiring review before installation. Do not run restore in a real workspace until bundled backups are removed, the backup source is explicitly selected, and diffs are inspected. Avoid committing or sharing generated backups, because they can contain user profiles, agent instructions, service configuration, and possibly credentials. Enable cron only after fixing the retention command and confirming exactly what data is backed up.
scripts/restore.mjs:164Bundled backups can overwrite active agent identity and instruction state
scripts/restore.mjs:28Unvalidated CLI path components permit directory traversal and unintended file access
scripts/backup.mjs:134Backup implementation accesses global OpenClaw data beyond the documented workspace scope
scripts/backup.mjs:24Configuration sanitization preserves non-string values under sensitive keys
examples/automated-backup.sh:1Automated retention command can recursively delete the complete backup store
The manual recovery example uses cp -r .../* . to copy backup contents into the workspace root, which can silently overwrite existing files without any prompt or audit trail. Because this bypasses the scripted restore safeguards and is presented as an emergency procedure, it materially increases the risk of irreversible loss of current configuration or identity files.
The document explicitly endorses a one-click installation model using curl | bash, which executes remotely fetched shell content without prior verification. If the hosting source, transport, or referenced script is compromised, users can be induced to run arbitrary commands on their system with the permissions of the invoking user.
**为什么不"直接复用现有方案":**
1. **架构不匹配:** 大多数工具假设打包 .app bundle,ClawLite 是 Node.js CLI 工具
2. **依赖地狱:** 采用 electron-builder 会增加 200+ 依赖
3. **用户体验差距:** ClawLite 的 "one-click install" (`curl | bash`) 与 DMG 下载流程不同
4. **维护负担:** 继承复杂安装框架意味着调试他人代码、跟踪上游破坏性更改
**为什么"维护自定义安装流程"更优:**
This section promotes curl | bash as the preferred installation method because it is simpler and faster, normalizing an unsafe execution pattern. That pattern bypasses review and integrity validation of fetched code, so a compromised endpoint or tampered installer can immediately execute arbitrary shell commands.
**为什么"维护自定义安装流程"更优:**
1. **控制:** ClawLite 安装脚本可随产品需求演进
2. **简单:** 当前 `curl | bash` 方法 50 行 shell 脚本,DMG 方法需 500+ 行
3. **速度:** Shell 脚本 5 分钟安装,DMG 下载 + 挂载 + 拖拽 + 首次运行需 10-15 分钟
4. **成本:** Shell 脚本无需公证费用 ($99/年 Apple Developer Program)
The recommendation to keep curl | bash as the primary distribution channel materially increases risk because it encourages widespread execution of unaudited remote scripts. In the context of developer tooling and agent/workspace setup, such scripts may access local files, credentials, git configuration, or modify execution environments, amplifying the consequences of compromise.
4. **成本:** Shell 脚本无需公证费用 ($99/年 Apple Developer Program)
**推荐混合方法:**
- **主要分发:** 保持 `curl | bash` (开发者和 CLI 用户)
- **次要分发 (未来):** 添加 Homebrew formula (可发现性和信任)
- **第三分发 (如果添加 GUI):** 使用 `create-dmg` 打包未来 Electron 仪表板
Even in the risk section, the document still frames curl | bash as an acceptable release-first approach, reinforcing insecure operational guidance. This can propagate unsafe installation behavior across users and teams, increasing the chance of arbitrary code execution if the installer source is ever compromised.
### P1 风险
- **过早采用复杂安装框架:** 推荐混合方法避免过度工程化
- **忽略用户反馈:** 先发布 `curl | bash`,根据反馈迭代
---
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
tup
# Add to crontab: crontab -e
0 2 * * * cd /Users/m1/.openclaw/workspace-hunter/soul-backup-skill && node scripts/backup.mjs --name "daily-$(date +\%Y-\%m-\%d)"
# Before deploying changes
cd soul-backup-skill
node scripts/backup.mjs --name "pre-deploy-$(git rev-parse --short HEAD)"
# Add to crontab
0 3 * * 0 cd /Users/m1/.openclaw/workspace-hunter/soul-backup-skill && node scripts/validate.mjs
Mitigation:
Likelihood: Negligible (2^256 space) Mitigation: None required (cryptographically secure)
Mitigation:
--dry-run firstThe documentation explicitly instructs use of a force option to overwrite existing files during restore conflict handling, which is a self-modifying operation against sensitive workspace control files. Although expected in a backup tool, this remains dangerous because these files govern agent identity, instructions, and tooling, so an incorrect restore or malicious backup could replace trusted configuration.
- Backup may be corrupted — use previous backup
**"Restore failed: file conflicts"**
- Use `--force` flag to overwrite existing files
- Or manually move conflicting files before restore
## Future Enhancements
The file's behavior is materially unrelated to the declared daily backup/restore purpose and instead bootstraps identity, persona, user profiling, and channel onboarding. In a backup skill context, this mismatch is dangerous because it can redirect the agent into collecting personal data and performing unrelated actions under the trusted label of a recovery/protection tool.
The file presented as a 'daily backup' skill is actually a broad runtime snapshot containing agent configuration, channel settings, provider integrations, execution policy, and authentication-related material. That scope mismatch is dangerous because a backup skill should be narrowly limited, while this artifact exposes operational capabilities and sensitive system structure that could be repurposed for persistence, lateral use, or unauthorized reconfiguration.
This configuration enables capabilities far beyond backup operations, including unrestricted subagent use ('*'), agent-to-agent operation, and command execution with confirmation disabled. In the context of a backup skill, these controls materially increase the risk that a restore or imported snapshot could grant broad execution authority or be abused as an operational control plane rather than a passive backup.
This file is a broad persona and workspace-governance prompt, not a narrowly scoped backup/restore skill. Embedding global operating instructions inside a backup skill can override task boundaries and cause the agent to read unrelated sensitive files, assume persistent autonomy, and perform actions far beyond backup or recovery.
The skill authorizes web access, calendar checks, and potentially sending communications, which are unrelated to daily backup of identity/config files. In a backup-skill context, these permissions unnecessarily expand the agent's capability surface and create opportunities for data exfiltration, unintended external actions, or misuse of connected accounts.
The heartbeat section instructs the agent to perform periodic monitoring of email, calendar, social notifications, weather, and memory maintenance, none of which are necessary for backup operations. In this context it effectively turns a backup skill into a general autonomous monitoring agent with recurring access to sensitive personal data.
This file's behavior is materially unrelated to the declared backup/recovery purpose of the skill and instead directs identity bootstrapping, profile collection, and social onboarding. In a backup skill context, this scope mismatch is dangerous because it can cause unauthorized collection of personal data, unexpected file modification, and user redirection into workflows that are outside the user's likely consent.
This file defines a standing personal-assistant identity, loyalty model, reporting behavior, memory model, and broad operational workflow that far exceeds the declared purpose of a backup/restore skill. In a backup context, these instructions can cause unauthorized persistence, cross-task behavior shaping, and covert handling of sensitive workspace data, making the skill effectively a general-purpose agent override rather than a narrowly scoped backup tool.
Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.
## Why Separate?
Skills are shared. Your setup is yours. Keeping them apart means you can update skills without losing your notes, and share skills without leaking your infrastructure.
---
Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.
## Why Separate?
Skills are shared. Your setup is yours. Keeping them apart means you can update skills without losing your notes, and share skills without leaking your infrastructure.
---
This configuration enables broad capabilities unrelated to a daily backup skill, including unrestricted agent allowance, external messaging channels, plugin activation, and networked gateway access. If this backup content is restored or trusted as part of the skill, an attacker could leverage the excessive permissions and integrations to expand control, trigger remote interactions, or persist unsafe runtime behavior.
The emergency recovery example uses cp -r .../* . in the workspace root, which can silently overwrite existing files without any warning or confirmation step. Because this skill's purpose is restoring core workspace identity/config files, the context makes overwrite risk more acute: users may run this during stressful recovery scenarios and unintentionally replace valid or newer data.
The README draft presents node scripts/restore.mjs as a quick-start command without clearly warning that restore operations overwrite existing workspace identity/config files. In a backup/restore skill, users are especially likely to copy-paste commands, so omission of an overwrite warning increases the chance of accidental destructive changes and unsafe use.
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.
Create a daily backup at 2 AM with automatic naming:
# Add to crontab: crontab -e
The restore examples instruct users to perform a real restore after only a dry-run preview, but they do not explicitly warn that the operation will overwrite current workspace files and may discard newer changes. In a backup/rollback skill, users are especially likely to run these commands during recovery, so omission of a destructive-action warning increases the chance of accidental data loss.
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.
CLI commands:
clawlite backup # Create timestamped backup
clawlite backup --name "pre-migration" # Named backup
clawlite restore # Restore latest
clawlite restore --name "pre-migration" # Restore named
The feature explicitly stores raw backups under a local directory while the same document acknowledges backups may contain API keys and sensitive identity/config data. Because the storage description appears without a prominent user-facing warning or mandatory protection requirement nearby, users may create plaintext backups in a predictable location and unintentionally expose secrets to other local users, backup tools, or malware.
This markdown file presents all operational instructions and safety-relevant recovery steps only in Chinese. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified, which is not present here.