T09 · Insecure Skill Coding Practices
- Location
SKILL.md:47- Finding
Docker Cleanup Command Can Delete User-Created Container State Without Confirmation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 47-54
Vulnerability Type: Unsafe destructive resource cleanup
Risk Level: MediumVulnerable Code
bash These four are pure caches. Every one regenerates on demand. Nothing the user created is touched. ```bash npm cache clean --force # commonly the single biggest win apt-get clean # package archives, already installed journalctl --vacuum-size=64M # keeps recent logs, drops the archive docker system prune -f # only if docker is present and unusedtext ### Technical Analysis The skill incorrectly describes all four operations as removal of regenerable caches that cannot affect user-created content. In particular, `docker system prune -f` is not restricted to cache data. It can delete stopped containers, unused networks, dangling images, and build cache. A stopped container may contain application or user-created state in its writable layer. Deleting the container permanently removes that state unless it was separately persisted in a volume or bind mount. The `-f` option suppresses Docker's interactive confirmation, and the instruction “only if docker is present and unused” does not define a reliable verification procedure for determining whether resources are safe to remove. The issue is an insecure skill instruction rather than evidence of an intentionally malicious payload. Nevertheless, the command contradicts the skill's safety guarantee and can cause destructive changes when followed by an agent with Docker access. ### Attack Path 1. A user asks the agent to reclaim disk space. 2. The agent follows Step 3 and determines, without a prescribed resource-level inspection, that Docker is “unused.” 3. The agent executes `docker system prune -f`. 4. Docker removes stopped containers and other unused resources without requesting confirmation. 5. User-created state stored only in a removed container' ...[truncated 1081 chars]- Remediation
View remediation
Remediation Suggestions
- Remove
docker system prune -ffrom the group described as “pure caches.” - Before proposing Docker cleanup, inspect and show the relevant state:
bash docker system df docker ps -a docker image ls docker network ls - Clearly explain that stopped containers may contain non-regenerable data in their writable layers.
- Require explicit, informed user approval after identifying the exact Docker resources eligible for deletion.
- Do not use
-fby default; preserve Docker's interactive confirmation as an additional safeguard. - Prefer narrowly scoped operations. If only build cache should be reclaimed, inspect it first and use
docker builder prunerather than pruning all categories of Docker resources. - Where stopped containers are candidates for deletion, verify that important state is persisted in named volumes or bind mounts and that the user has a tested recovery path.
- Reword the safety claim so it does not state that Docker pruning affects only regenerable caches or that user-created content cannot be touched.
- Remove
