T09 · Insecure Skill Coding Practices
- Location
SKILL.md:55- Finding
Unencrypted Backup May Expose Sensitive OpenClaw Data
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 55-57; related backup-content declaration at lines 115-119
Vulnerability Type: Sensitive data stored in an unprotected archive
Risk Level: MediumVulnerable Code:
bash # Execute backup cd "$OPENCLAW_DIR" tar -czf "$BACKUP_DIR/openclaw-backup-$(date +%Y%m%d-%H%M%S).tar.gz" .openclaw/The documented backup contents include:
text - `~/.openclaw/` — All config and data - `~/.openclaw/workspace/` — Workspace and skills - `~/.openclaw/openclaw.json` — Main config fileTechnical Analysis
The Skill instructs the agent to place the complete OpenClaw data directory into a gzip-compressed tar archive. Compression does not provide confidentiality or integrity. The command neither encrypts the archive nor explicitly establishes restrictive permissions through a secure
umask.The destination is an automatically inferred writable directory or a user-provided path. Such a path may be a NAS share, shared mount, or directory with permissions broader than intended. Because the backup covers all configuration and data, it may contain authentication tokens, credentials, private configuration, conversation data, installed Skills, or other sensitive workspace files.
An additional correctness defect exists in the shown command: after changing into
"$OPENCLAW_DIR"—documented as/root/.openclaw—the archive operand.openclaw/refers to/root/.openclaw/.openclaw/. This likely causes backup failure unless that nested directory exists. Although this defect is not itself a security vulnerability, it can create a false expectation that a valid backup was produced.Attack Path
- A backup is created in an automatically inferred or manually selected directory.
- The destination is accessible to another NAS user, service, container, or process because it is shared or has permissive directory permissions.
- The archive inherits permissi ...[truncated 727 chars]
- Remediation
View remediation
Remediation Suggestions
-
Set a restrictive process mask before creating the archive:
bash umask 077 -
Create the archive with a temporary name, verify successful completion, explicitly set mode
0600, and then rename it atomically. -
Verify that the destination is owned by the expected user and is not writable or readable by unintended users, groups, containers, or network-share clients.
-
Warn users not to store backups in public or broadly shared NAS directories.
-
Protect backup confidentiality and integrity with authenticated encryption, such as
age, GPG, or another approved backup-encryption mechanism. -
Exclude secrets that are unnecessary for restoration, or store them using a separate secret-management and recovery process.
-
Correct the archive source path. For example:
bash umask 077 cd /root tar -czf "$BACKUP_DIR/openclaw-backup-$(date +%Y%m%d-%H%M%S).tar.gz" .openclaw/ chmod 600 "$BACKUP_DIR"/openclaw-backup-*.tar.gz -
Verify archive readability and expected contents after creation, and clearly report any backup failure.
-
