T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:33
- Finding
- Forced Docker Volume Pruning Can Irreversibly Delete Persistent Data## Vulnerability Details **File Location**: `SKILL.md`, lines 33-35 **Vulnerability Type**: Destructive cleanup without adequate validation or consent **Risk Level**: High ```bash docker builder prune -f # Build cache docker image prune -f # Dangling images only docker volume prune -f # Dangling volumes ``` ### Technical Analysis The Skill presents these operations as the safest cleanup category, but `docker volume prune -f` permanently deletes all local volumes Docker considers unused and suppresses the interactive confirmation prompt. A volume can be detached from every container while still containing valuable database files, application state, backups, or user-generated content. Docker's “unused” determination does not establish that data is obsolete. The procedure does not require a volume inventory, data-owner confirmation, backup, content inspection, or explicit approval before deletion. Access to the Docker daemon also commonly provides privileges comparable to root over Docker-managed resources, so this operation has broader consequences than ordinary user-cache cleanup. ### Attack Path 1. A user invokes the Skill because the host has low disk space. 2. The agent selects the section described as the safest cleanup option. 3. One or more valuable volumes are currently detached from their containers, such as during maintenance or container replacement. 4. The agent executes `docker volume prune -f` without presenting the deletion set or requesting approval. 5. Docker permanently removes the detached volumes and their contents. 6. Applications subsequently fail or lose persistent state when their containers are recreated. ### Impact Assessment The operation can irreversibly destroy databases, application state, backups, and user data stored in detached Docker volumes. The scope is all unused volumes managed by the Docker daemon available to the executing account. It d ...[truncated 191 chars]
- Remediation
- ## Remediation Suggestions - Do not describe volume pruning as unconditionally safe. - Remove `-f` from the default documented command so that Docker displays its confirmation prompt. - Inventory volumes with `docker volume ls` and map each candidate to current and historical containers. - Inspect labels, mount points, ownership, and contents before deletion. - Require explicit user approval for the exact named volumes that will be removed. - Back up volumes containing persistent application data before cleanup. - Prefer deleting individually verified volumes with `docker volume rm VOLUME_NAME` rather than globally pruning all unused volumes. - Separate low-risk build-cache cleanup from potentially destructive volume cleanup and clearly label the latter as high risk.
