T09 · Insecure Skill Coding Practices
- Location
healthy-backup.sh:58- Finding
Raw OpenClaw Configuration Is Included in Migratable and Full Backups
- Content
View full analysis
Vulnerability Details
File Location:
healthy-backup.sh:58-62, 188-193, 222-230
Vulnerability Type: Sensitive data exposure caused by incomplete backup exclusions
Risk Level: HighVulnerable Code:
bash EX=(--exclude=shared/secrets/ --exclude=credentials/ --exclude='*.key' --exclude='*.pem' --exclude='*.env' --exclude='*.secret' --exclude='.env' --exclude='.git/' --exclude='node_modules/' --exclude='BACKUPS/')bash sync_dir() { local s="$1" d="$STAGING/$2" shift 2 mkdir -p "$d" rsync -a "${EX[@]}" "$@" "$s/" "$d/" } stage_config() { mkdir -p "$STAGING/config" jq 'walk(if type=="object" then with_entries( if (.key|test("password|token|secret|key";"i")) then .value="<redacted>" else . end) else . end )' "$OC_CFG" > "$STAGING/config/openclaw.json" ok "openclaw.json (scrubbed)" }bash case "$TIER" in migratable) stage_config sync_dir "$OC" openclaw --exclude='logs/' --exclude='media/' --exclude='browser/' ok "~/.openclaw"; stage_deps ;; full) stage_config sync_dir "$OC" openclaw --exclude='logs/' --exclude='media/' --exclude='browser/' ok "~/.openclaw"; stage_deps [ -d "$WORKSPACE" ] && { sync_dir "$WORKSPACE" workspace --exclude='canvas/'; ok "workspace"; } || warn "workspace not found" [ -d "$SKILLS" ] && { sync_dir "$SKILLS" skills --exclude='.venv/'; ok "skills"; } || warn "skills not found" ;; esacTechnical Analysis
stage_configcorrectly creates a scrubbed copy atconfig/openclaw.json. However, the migratable and full tiers then recursively synchronize the entire~/.openclawdirectory intoopenclaw/.The exclusion list removes credential directories and selected filename patterns, but it does not exclude the root-level
openclaw.json. Consequently, the archive can contain both:- `config/op ...[truncated 1772 chars]
- Remediation
View remediation
Remediation Suggestions
- Explicitly exclude the source configuration when synchronizing
~/.openclaw:bash sync_dir "$OC" openclaw \ --exclude='/openclaw.json' \ --exclude='logs/' \ --exclude='media/' \ --exclude='browser/' - Keep only the scrubbed
config/openclaw.jsonin the archive. - Apply the exclusion as a source-root-relative rule so similarly named nested files are not unintentionally affected.
- Add automated tests for every backup tier that decrypt the resulting archive and assert:
- No
openclaw/openclaw.jsonexists. - Exactly one intended scrubbed configuration copy exists.
- Known test secrets do not appear anywhere in extracted archive content.
- No
- Treat backups created by affected versions as potentially containing raw credentials. Rotate sensitive credentials and securely delete or replace affected local and remote archives.
- Update release checksums and documentation after publishing the corrected script.
- Explicitly exclude the source configuration when synchronizing
