T09 · Insecure Skill Coding Practices
- Location
SKILL.md:33- Finding
Forced Docker Volume Pruning Can Irreversibly Delete Persistent Data
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 33-35
Vulnerability Type: Destructive cleanup without adequate validation or consent
Risk Level: Highbash docker builder prune -f # Build cache docker image prune -f # Dangling images only docker volume prune -f # Dangling volumesTechnical Analysis
The Skill presents these operations as the safest cleanup category, but
docker volume prune -fpermanently 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
- A user invokes the Skill because the host has low disk space.
- The agent selects the section described as the safest cleanup option.
- One or more valuable volumes are currently detached from their containers, such as during maintenance or container replacement.
- The agent executes
docker volume prune -fwithout presenting the deletion set or requesting approval. - Docker permanently removes the detached volumes and their contents.
- 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
View remediation
Remediation Suggestions
- Do not describe volume pruning as unconditionally safe.
- Remove
-ffrom the default documented command so that Docker displays its confirmation prompt. - Inventory volumes with
docker volume lsand 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_NAMErather 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.
