Back to skill

Security audit

VPS Backup

Security checks for vulnerabilities and agentic risk

Overview

This backup skill is mostly coherent, but it handles SSH keys, agent state, transcripts, remote sync, scheduled runs, and unverified downloaded code in ways that deserve careful review before use.

Install only if you intend to back up credentials, agent state, transcripts, and source code. Prefer removing ~/.ssh from the default paths unless private-key recovery is required, pin and verify restic/rclone/session-exporter downloads, review any exported-session script before scheduling it, and treat any rclone destination as containing highly sensitive encrypted backups.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T03 · Remote Payload Retrieval and Execution

Error
Location
docs/config.md:43
Finding

Mutable Remote Session Archiver Is Downloaded and Automatically Executed

Content
View full analysis
/dev/null && logok "Sessions exported" || logwr "Session export failed (non-fatal)" elif [[ -f "$SESSION_EXPORT" ]]; then logwr "Session export script not executable — run: chmod +x $SESSION_EXPORT" fi ``` The documentation also demonstrates unattended scheduled execution: ```bash 0 3 * * * \ python3 /home/dev/scripts/export_sessions.py && \ export BACKUP_PASSWORD=$(cat ~/.backup-password) && \ bash /home/dev/scripts/vps-backup.sh \ >> /var/log/vps-backup.log 2>&1 ``` ### Technical Analysis The installation instructions retrieve Python code from the mutable `main` branch of a third-party personal GitHub repository. The download is not pinned to an immutable commit and is not validated using a cryptographic checksum or signature. The downloaded file is marked executable and later invoked with Python by both the backup script and the documented cron configuration. Its implementation is not included in the audited project, so its effective behavior cannot be verified and may change after this Skill has been reviewed. Because the backup process reads sensitive OpenClaw state, project data, session transcripts, and SSH credentials, an upstream payload would execute in a particularly sensitive context. ### Attack Path 1. A ...[truncated 1519 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
SKILL.md:26
Finding

Unpinned Downloaded Binaries Are Installed into a Privileged System Path Without Integrity Verification

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/vps-backup.sh:12
Finding

SSH Private Keys and Broad Credential-Bearing Directories Are Backed Up and Eligible for Offsite Synchronization by Default

Content
View full analysis
/dev/null; then log "Pushing to $RCLONE_DEST..." rclone sync "$BACKUP_ROOT" "$RCLONE_DEST" --quiet 2>&1 \ && logok "Offsite push done" \ || logwr "Offsite push failed" fi ``` ### Technical Analysis The default backup scope includes the entire `~/.ssh` directory as well as broad OpenClaw and OpenCode configuration trees. These locations may contain: - SSH private keys. - SSH connection metadata and known host information. - API tokens and service credentials. - Agent memory, session data, and private conversations. - Model-provider configuration and authentication data. Backing up SSH private keys is not required for the narrower purpose of preserving application workspace and project state. Including them by default therefore exceeds minimum privilege and data-collection requirements. Restic encryption mitigates direct disclosure, but the design concentrates multiple high-value credential sets into a single repository protected by one password. The repository is also eligible for synchronization to a user-configured rclone remote. A compromise of the repository, password, remote account, backup account, or executed dependency may expose all included secrets. The rclone destination is user-configured, and no hard-coded exfiltration endpoint was found. The concern is the excessive default data scope and the consequences of compromise, not covert transmission to ...[truncated 1686 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (11)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill clearly instructs shell execution, downloading binaries, modifying system paths, reading secrets from disk, and scheduling unattended jobs, but it declares no tool scope or permissions boundary. That increases the chance an agent or user invokes powerful shell actions without explicit review, especially in an automation context handling sensitive backup material.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description says the skill backs up SSH keys, agent state, project code, and session transcripts, but it does not prominently warn that these are highly sensitive secrets and may be copied to local repositories or offsite cloud storage. Users may enable backups or offsite push without understanding they are exporting credentials, private conversations, and source code, creating confidentiality risk through misconfiguration or compromise of the backup destination.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

bash
# 1. Generate encryption password
openssl rand -base64 32 > ~/.backup-password
chmod 600 ~/.backup-password

# 2. Verify restic repo (after first backup)
export RESTIC_PASSWORD=$(cat ~/.backup-password)

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · docs/config.md (reported line 19)May include surrounding context.

bash
# 1. Generate encryption password
openssl rand -base64 32 > ~/.backup-password
chmod 600 ~/.backup-password

# 2. Verify restic repo (after first backup)
export RESTIC_PASSWORD=$(cat ~/.backup-password)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation instructs users to download and run a Python script directly from a remote GitHub source using curl, then execute it, without any integrity verification, pinning to a specific commit, checksum validation, or trust warning. This creates a supply-chain risk: if the repository, branch, or network path is compromised, users could execute attacker-controlled code that has access to sensitive backup data and session transcripts.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

sh
# --- Setup directories ---
mkdir -p "$BACKUP_ROOT" "$RESTIC_REPO"
chmod 700 "$BACKUP_ROOT"
chmod 600 "${HOME}/.backup-password" 2>/dev/null || true

# --- Export session transcripts (optional) ---

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

sh
# --- Setup directories ---
mkdir -p "$BACKUP_ROOT" "$RESTIC_REPO"
chmod 700 "$BACKUP_ROOT"
chmod 600 "${HOME}/.backup-password" 2>/dev/null || true

# --- Export session transcripts (optional) ---
if [[ -x "$SESSION_EXPORT" ]]; then

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script can automatically push the local backup set to a remote rclone destination whenever RCLONE_DEST is set, but it provides no explicit consent prompt, destination validation, or warning that highly sensitive data is included in the backup. In this skill's context, the backup contains SSH keys, OpenClaw data, project code, and session transcripts, so an unintended or misconfigured remote sync could disclose very sensitive material off-host.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The file says old snapshots are pruned automatically after each run, but it does not explicitly warn that this is a destructive, irreversible deletion of historical backup data according to retention policy. In markdown guidance for backup tooling, users should be clearly alerted before enabling behavior that removes recovery points.

Content

No source excerpt is available for this finding.