T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- SKILL.md:170
- Finding
- Host Docker Socket Exposure Grants Host-Equivalent Privileges<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:170-172` **Vulnerability Type**: Host Docker daemon exposure **Risk Level**: High ### Vulnerable Code ```bash docker run -d --name your-bot \ -v /var/run/docker.sock:/var/run/docker.sock \ -e OPENCLAW_SANDBOX=1 \ ``` ### Technical Analysis The recommended deployment mounts the host Docker daemon socket inside the bot container. Possession of this socket generally provides host-root-equivalent control because a process can instruct Docker to: - Launch privileged containers. - Mount the host root filesystem. - Access other containers and their environments. - Modify host files or install persistent services. - Enter host namespaces. This is especially dangerous for a public, prompt-driven Telegram bot with shell execution capabilities. The document acknowledges the tradeoff at line 194, but the permission still exceeds what is minimally required to receive Telegram messages or generate media. ### Attack Path 1. An attacker sends adversarial input to the public Telegram bot. 2. Prompt injection or a tool-control failure causes the agent to execute shell commands. 3. The compromised process connects to `/var/run/docker.sock`. 4. It creates a privileged container that mounts the host filesystem. 5. The attacker reads host secrets, changes host files, or obtains unrestricted host command execution. ### Impact Assessment Successful exploitation can provide effective root access to the Docker host. The scope includes all containers managed by that daemon, host-mounted files, service credentials, application data, and potentially the entire server. ]]>
- Remediation
- <![CDATA[ ## Remediation Suggestions - Do not mount the host Docker socket into the public bot container. - Place sandbox orchestration on a separate, dedicated host or behind a narrowly scoped broker API. - If container creation is unavoidable, use rootless container isolation and a Docker authorization plugin with an explicit operation allowlist. - Prevent the bot identity from creating privileged containers, mounting arbitrary host paths, joining host namespaces, or accessing unrelated containers. - Separate the public message-processing component from the privileged sandbox manager using distinct users, hosts, and credentials. - Monitor Docker API activity and alert on privileged containers, host-path mounts, and unexpected image execution. ]]>
