T09 · Insecure Skill Coding Practices
- Location
scripts/snapshot.py:119- Finding
Sensitive configuration and secret files are copied without backup encryption
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This backup skill fits its stated purpose, but it needs review because it copies secrets and workspace data into persistent snapshots without implementing the encryption it claims.
Install only if you are comfortable with this skill storing copies of your OpenClaw credentials, .env, configuration, skills, and workspace files under ~/.openclaw/snapshots. Treat those snapshots as sensitive secret material, restrict local access, avoid syncing or sharing them, and be cautious restoring snapshots from any location another process or person could modify.
scripts/snapshot.py:119Sensitive configuration and secret files are copied without backup encryption
scripts/restore.py:68Unauthenticated snapshot contents can overwrite active OpenClaw state during restoration
scripts/cleanup.py:35Retention cleanup can delete full snapshots required by incremental snapshots
Including .env in the backup target list causes the snapshot process to collect secret-bearing environment files, which commonly contain API keys, tokens, database credentials, and other sensitive material. Because the script persists these secrets into snapshot storage alongside other copied data, compromise of the snapshot directory or later reuse of snapshots can directly expose credentials.
"channels",
"skills",
"credentials",
".env"
]
# Workspace files (the entire workspace directory)
The skill explicitly backs up highly sensitive material including 'credentials/*' and '.env', but the description does not prominently warn users about the sensitivity, storage implications, or access controls for those backups. Backups concentrate secrets into restorable artifacts, so if snapshots are viewed, copied, or stored insecurely, credentials and environment secrets may be exposed or reused by an attacker.
The trigger phrases are generic backup-related language such as 'create backup' and 'delete snapshot', which can overlap with ordinary user requests and cause the skill to activate unexpectedly. In a skill that can create, restore, or delete snapshots of configuration and memory, unintended invocation can lead to unauthorized state changes, accidental rollback, or exposure of sensitive backup contents.
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.
#!/usr/bin/env python3
"""
Way Back - Create Snapshot
Usage: python snapshot.py [--full]
"""
import os
The script is designed to back up sensitive configuration material, including credentials and environment files, into snapshot storage without any warning, consent step, masking, or access-control considerations. In an agent skill context, silently aggregating secrets and workspace contents into a centralized snapshot directory increases the chance of accidental disclosure, later exfiltration, or overly broad retention of confidential data.
The code comment at L188 says 'Incremental - store changed files', but the loops at L195-L213 unconditionally copy every existing target and workspace item without comparing hashes or changes. This also conflicts with the metadata field 'patch_count' and the implied intent of an incremental snapshot, because the implementation behaves like a full copy of selected content.
The retention settings describe automatic deletion of backups based on age or count, but there is no clear warning that deletion may be irreversible and could remove the only recovery point. In a backup skill, users may overestimate recoverability, and silent cleanup can increase the chance of permanent data loss after a failed change or delayed incident response.
No suspicious patterns detected.