T09 · Insecure Skill Coding Practices
- Location
scripts/create_backup.sh:112- Finding
Sensitive backup archives may be created with overly permissive filesystem permissions
- Content
View full analysis
/dev/null)" ]]; then BACKUP_PATH="${PARENT_DIR}/pre-restore-backup-${TIMESTAMP}.tar.gz" tar -C "$PARENT_DIR" -czf "$BACKUP_PATH" "$TARGET_NAME" safe_create_checksum "$BACKUP_PATH" "${BACKUP_PATH}.sha256" printf 'Created pre-restore backup: %s\n' "$BACKUP_PATH" fi ``` ### Technical Analysis The scripts archive the complete OpenClaw state, which may include credentials, access tokens, private configuration, conversation data, and other sensitive files. However, the scripts neither set a restrictive process `umask` nor explicitly apply secure permissions to the output directory, completed archives, temporary archives, pre-restore archives, or checksum files. File permissions therefore depend on the invoking process's environment. Under a common `umask` of `022`, newly created archives are normally readable by all local users, such as mode `0644`, while newly created directories may use mode `0755`. Although the staging directory produced by `mktemp -d` is normally private, the final archive is moved into the configured output directory and retains the permissions assigned when the temporary archive was created. The same issue affects pre-restore archives created next to the restore target. ### Attack Path 1. A user runs `scripts/create_backup.sh` with a permissive `umask`, such as `022`. 2. The script packages the entire OpenClaw state into ...[truncated 994 chars]- Remediation
View remediation
