other
Warning
- Location
- SKILL.md:180
- Finding
- Destructive cleanup guidance can delete persistent memory files## Vulnerability Details **File Location**: `SKILL.md:180` **Vulnerability Type**: Destructive File Deletion **Risk Level**: Medium ### Vulnerable Code ```bash find ~/.openclaw/workspace/memory -name "2026-*.md" -mtime +30 -delete ``` ### Technical Analysis The Skill recommends recursively deleting every Markdown file under `~/.openclaw/workspace/memory` whose name matches `2026-*.md` and whose modification time exceeds 30 days. The command does not verify that matched files are disposable logs, does not provide a dry run, does not request confirmation, and does not create a backup. The target directory may contain persistent Agent memory, generated reports, or unrelated Markdown records. The filename pattern is insufficient to distinguish temporary logs from valuable state. This destructive operation is also inconsistent with the Skill's claims that it performs read-only analysis and does not modify other files. Although the analyzer script does not automatically execute this command, a user or Agent following the Skill's documented optimization procedure could run it directly. ### Attack Path 1. A user or Agent loads the Skill and follows its context-optimization guidance. 2. The documented `find` command is executed in the user's environment. 3. `find` recursively searches the complete OpenClaw memory directory. 4. Every file matching `2026-*.md` and older than 30 days is deleted without confirmation. 5. Persistent memory or unrelated records matching those conditions are irreversibly lost unless an external backup exists. ### Impact Assessment The command runs with the invoking user's filesystem privileges. It can delete any matching file beneath the user's OpenClaw memory directory, including long-term Agent state and unrelated Markdown records. It does not provide broader privilege escalation, network access, or deletion outside the specified directory, but the resulting loss of persistent state may affect future Agent sessions and stored operat ...[truncated 14 chars]
- Remediation
- ## Remediation Suggestions Remove the destructive command from the Skill documentation. If cleanup functionality is required: 1. Restrict it to a dedicated, documented disposable-log directory. 2. Identify files using validated metadata rather than a broad filename pattern. 3. Display candidates first with a non-destructive command: ```bash find ~/.openclaw/workspace/memory/conversations \ -type f -name "*.jsonl" -mtime +30 -print ``` 4. Require explicit user confirmation before deletion. 5. Exclude persistent memory and report files by construction. 6. Recommend creating a backup or moving candidates to a quarantine directory before permanent deletion. 7. Update the read-only security claims if destructive maintenance remains part of the documented workflow.
