T09 · Insecure Skill Coding Practices
- Location
openclaw-backup.sh:26- Finding
Sensitive OpenClaw backups are created without enforced access restrictions or encryption
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This backup skill is mostly purpose-aligned, but it handles sensitive OpenClaw identity data and restores archives in a way that can overwrite trusted agent files.
Review before installing. Only restore backups you created and trust, make a fresh backup before restoring, and inspect archives before extracting them. Treat generated backup files as sensitive because they may contain agent memory, identity, configuration, and credentials; store or transfer them only with strong local permissions and encryption. Use the auto-backup hook or crontab only if you are comfortable with recurring backup execution from your OpenClaw workspace.
openclaw-backup.sh:26Sensitive OpenClaw backups are created without enforced access restrictions or encryption
"
echo ""
echo "📂 Place your backup file anywhere, e.g.:"
echo " ~/Downloads/openclaw-backup-2026-03-09.tar.gz"
exit 1
fi
BACKUP_FILE="$1"
# Expand ~ if present
BACKUP_FILE="${BACKUP_FILE/#\~/$HOME}"
if [ ! -f "$BACKUP_FILE" ]; then
echo "❌ Error: File not found: $BACKUP_FILE"
exit 1
fi
echo "⚠️ This will restore your agent from: $BACKUP_FILE"
echo " Existing files may be overwritten."
read -p "Cont
...[truncated 3036 chars]:52Untrusted backup archives are extracted into the user home directory without content validation
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.
## When to Use
- User wants to create a backup of their agent
- User wants to move to a new computer
- User asks how to preserve their agent's memory/identity
- Important memories or updates happened — time to save!
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.
Or add daily backups via crontab:
crontab -e
# Add: 0 2 * * * ~/.openclaw/workspace/skills/openclaw-backup/openclaw-backup.sh create
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.
Or add daily backups via crontab:
```bash
crontab -e
# Add: 0 2 * * * ~/.openclaw/workspace/skills/openclaw-backup/openclaw-backup.sh create
```
The restore instructions tell users to extract a backup tarball directly into the home directory without warning that existing ~/.openclaw data may be overwritten or merged. This can cause accidental loss or corruption of current agent state, and if the archive contents are untrusted or stale, it can replace configuration or session data unexpectedly.
The setup-auto command writes an executable hook into the agent workspace that will repeatedly invoke the backup script, creating a persistence mechanism inside the OpenClaw environment. Although the apparent goal is legitimate auto-backup, persistence features are security-sensitive because they cause future code execution and could be abused if the workspace or skill path is modified by an attacker.
cmd_setup_auto() {
echo "🔧 Setting up auto-backup hook..."
# Create a hook script that backs up when called
mkdir -p "$WORKSPACE_DIR/.hooks"
cat > "$WORKSPACE_DIR/.hooks/post-memory-save.sh" << 'HOOK'