Back to skill

Security audit

Openclaw Backup

Security checks for vulnerabilities and agentic risk

Overview

This backup skill is mostly purpose-aligned, but it can move broad workspace data and encrypted secret archives to GitHub under weaker controls than its documentation suggests.

Review and modify this skill before installing in a sensitive environment. Treat operational archives as private and potentially sensitive, do not push backups to GitHub unless you have inspected their contents, pass secrets to upload only by explicit intent, use strong age keys, and only restore archives from a trusted source.

Vulnerability Patterns
  • 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
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/backup.sh:181
Finding

Unencrypted operational backups can expose sensitive workspace data to GitHub

Content
View full analysis
/dev/null git push origin HEAD >/dev/null info "Pushed backup to $REMOTE" fi ) ``` ### Technical Analysis The backup process recursively copies the entire OpenClaw workspace into an unencrypted operational archive. Only `openclaw.json` is passed through the key-name-based redaction routine. No exclusion or content-scanning logic is applied to the workspace. Consequently, the operational archive may contain: - `.env` files located below the workspace - Private keys or credential exports - API tokens embedded in scripts or configuration files - Personal information in `MEMORY.md` and daily memory files - Private Git repository metadata and remote URLs - Authentication dat ...[truncated 1914 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/push-to-github.sh:90
Finding

GitHub uploader automatically includes encrypted secret archives without explicit upload consent

Content
View full analysis
/dev/null git push origin HEAD >/dev/null info "Pushed backup to $REMOTE" fi ) ``` ### Technical Analysis When the operator does not provide `--secrets`, the script reads the supplied manifest, locates an adjacent encrypted secrets archive, and sets `SECRETS_PATH` automatically. It then copies and commits that archive. This contradicts the documented security model: - The documented GitHub command is described as operational-only. - Secret archives are described as local-only by default. - The ...[truncated 1839 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/backup.sh:204
Finding

Plaintext secret archive is written to persistent storage with inherited permissions

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/restore.sh:186
Finding

Restore executes code supplied by an unauthenticated backup archive

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (16)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 20)May include surrounding context.

md
| Archive | Contents | Where it goes |
|---------|----------|---------------|
| **Operational** `openclaw-backup-*.tar.gz` | Workspace (SOUL, MEMORY, scripts, skills, memory), config (redacted), crons | Local + Google Drive + GitHub ✅ |
| **Secrets** `openclaw-secrets-*.tar.gz.age` | .env (API keys), agent auth profiles (OAuth tokens) | 🔒 Local only, encrypted with `age` |
| **Manifest** `manifest.json` | Checksums, versions, file list, timestamps | Alongside both archives |

**Secrets never touch cloud storage unencrypted.** The push-to-github script hard-refuses if it detects unencrypted secrets.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The supplied code is specifically a backup creation script. It stages selected OpenClaw files, creates a tar.gz operational archive, optionally creates and age-encrypts a secrets archive, and generates a manifest containing SHA-256 checksums and metadata. This aligns with part of the declared description: two-tier backup archives, age encryption for secrets, and manifest checksum generation. However, the description presents a broader skill covering backup and restore, atomic restore safety mechanisms, GitHub push behavior, and daily scheduling. None of those additional capabilities appear in this code chunk. Because the declared purpose materially overstates what this code actually does, the description does not accurately represent the supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The code chunk partially matches the declared description only in the narrow area of pushing backup artifacts to GitHub with a safeguard against uploading unencrypted secrets archives. However, the declared purpose describes a substantially broader backup-and-restore system with encryption, checksum verification, atomic restore protections, and scheduled backups. None of those core capabilities are implemented in this provided code. Since the actual chunk’s primary behavior is just GitHub repository management and pushing existing files, the description does not accurately represent what this code chunk itself does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description presents a broad backup/restore system with encryption, verification, restore safety, GitHub integration, and scheduling. The actual supplied code chunk is much narrower: it configures a scheduled cron job in OpenClaw that will later run backup.sh. While daily scheduled backups are mentioned in the description, this code does not itself implement backup creation, restore, encryption, checksum verification, rollback, or GitHub push. Its primary behavior is cron management, which is only one supporting aspect of the declared system. Because the provided chunk materially differs from the declared purpose and lacks most of the claimed capabilities, this should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/backup.sh (reported line 193)May include surrounding context.

sh
copy_file "$OPENCLAW_DIR/cron/jobs.json" "$OP_STAGE/openclaw/cron/jobs.json" "cron/jobs.json"

if [ "$INCLUDE_SECRETS" -eq 1 ]; then
  copy_file "$OPENCLAW_DIR/.env" "$SEC_STAGE/openclaw/.env" ".env"
  copy_dir "$OPENCLAW_DIR/agents" "$SEC_STAGE/openclaw/agents" "agents/"
fi

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/backup.sh (reported line 205)May include surrounding context.

sh
copy_file "$OPENCLAW_DIR/cron/jobs.json" "$OP_STAGE/openclaw/cron/jobs.json" "cron/jobs.json"

if [ "$INCLUDE_SECRETS" -eq 1 ]; then
  copy_file "$OPENCLAW_DIR/.env" "$SEC_STAGE/openclaw/.env" ".env"
  copy_dir "$OPENCLAW_DIR/agents" "$SEC_STAGE/openclaw/agents" "agents/"
fi

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/pre-change-snapshot.sh (reported line 19)May include surrounding context.

sh
TMP_OUTPUT="$(mktemp "${TMPDIR:-/tmp}/openclaw-snapshot.XXXXXX")"
STAGE_ROOT="$(mktemp -d "${TMPDIR:-/tmp}/openclaw-snapshot-stage.XXXXXX")"
trap 'rm -f "$TMP_OUTPUT"; rm -rf "$STAGE_ROOT"' EXIT

bash "$BACKUP_SCRIPT" --no-secrets --output-dir "$STAGE_ROOT" >"$TMP_OUTPUT"

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/pre-change-snapshot.sh (reported line 19)May include surrounding context.

sh
TMP_OUTPUT="$(mktemp "${TMPDIR:-/tmp}/openclaw-snapshot.XXXXXX")"
STAGE_ROOT="$(mktemp -d "${TMPDIR:-/tmp}/openclaw-snapshot-stage.XXXXXX")"
trap 'rm -f "$TMP_OUTPUT"; rm -rf "$STAGE_ROOT"' EXIT

bash "$BACKUP_SCRIPT" --no-secrets --output-dir "$STAGE_ROOT" >"$TMP_OUTPUT"

Session Persistence

Medium
Category
Rogue 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.

Content

Scanner excerpt · README.md (reported line 135)May include surrounding context.

Weekly verify — Sundays at 3 AM

bash
openclaw cron create \
  --name "OpenClaw Weekly Backup Verify" \
  --cron "0 3 * * 0" \
  --system-event "Run bash '$HOME/.openclaw/workspace/skills/openclaw-backup/scripts/weekly-verify.sh' and return the output exactly."

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill invokes shell scripts for backup, restore, scheduling, and GitHub push, but the manifest does not declare any tool restrictions such as permissions or allowed-tools. That omission widens the trust boundary: a consumer may authorize the skill without realizing it needs shell, file read, and file write capabilities, increasing the risk of unintended filesystem changes or command execution if the referenced scripts are unsafe or replaced.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The guide instructs users to run restore and restart operations that modify a live OpenClaw installation, but it does not prominently warn that these actions can overwrite the current state, interrupt service, and trigger rollback-sensitive changes. In a disaster-recovery skill this is expected functionality, but the missing caution increases the chance of operator error and unintended disruption.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The partial-restore examples copy files directly into live OpenClaw paths using cp, which can overwrite existing workspace, config, or cron data without any confirmation or backup step. Although intended for recovery, these commands are risky because they make targeted destructive changes outside the atomic restore workflow and could leave the agent in an inconsistent state.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script silently removes snapshot run directories beyond the five most recent backups using shutil.rmtree. Although the script prints the final snapshot path, it does not disclose this retention-based deletion behavior to the user via comments, logs, or confirmation, making a destructive operation easy to miss.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

This shell script deletes an existing cron job with the same name and creates a new one, which is a system-modifying operation. Although it prints status messages, those messages do not clearly warn the user beforehand that an existing scheduled task will be removed and replaced, and there is no confirmation prompt or explanatory comment/docstring disclosing that impact.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script prunes old backup run directories with rm -rf and only reports aggregate cleanup counts after completion. There is no confirmation prompt or explicit user-facing notice before deletion, so users may not realize the script performs irreversible cleanup when it runs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script removes manifest.json files lacking archives and deletes orphan secret archives with rm -f, but it provides no per-action warning, confirmation, or inline explanation near the destructive operations. Although a summary is printed afterward, that does not disclose the deletions before they occur.

Content

No source excerpt is available for this finding.