T09 · Insecure Skill Coding Practices
- Location
cleanup.sh:107- Finding
Sensitive session artifacts are retained indefinitely with permissions dependent on the caller's umask
- Content
View full analysis
/dev/null || { echo -e "${RED}Failed to move: $basename_file${NC}" return 1 } ``` The documentation states: ```markdown - **Moves to `.trash/` first** instead of permanent deletion (recoverable for 30 days) - **Logs all actions** to `~/.openclaw/logs/session-cleanup.log` ``` ### Technical Analysis The Skill moves session backups, checkpoints, trajectory logs, and index files into a trash directory, but it never removes trash entries after the documented 30-day recovery period. Consequently, cleanup does not actually eliminate sensitive data; it relocates and retains it indefinitely. The trash and log directories are created with `mkdir -p` without an explicit permission mode or a restrictive `umask`. Their effective permissions therefore depend on the environment in which the script is run. Session and trajectory artifacts can contain private conversation data, model reasoning traces, file paths, or other operational information. This behavior contradicts the documented 30-day retention guarantee and unnecessarily increases the duration and number of locations in which sensitive data remains available. ### Attack Path 1. A user runs the cleanup script manually or through the documented weekly scheduler. 2. Aged session or trajectory artifacts are moved into `$OPENCLAW_STATE_DIR/.trash/sessions/YYYYMMDD`. ...[truncated 773 chars]- Remediation
View remediation
