Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is a Container Escape?

A container escape is an attack in which code inside a container breaks its isolation and reaches the host, exposing every other container on that node and the node’s cloud identity.

Illustration for the cybersecurity term Container Escape
Home / Blog / Cybersecurity Terms / What Is a Container Escape?
17 November 2026

What Is a Container Escape?

What Is a Container Escape?

A container escape is the moment an attacker stops being confined to a container and gains execution on the host beneath it. Because containers share one kernel rather than running their own, the boundary between them is a set of kernel features—namespaces, control groups, capabilities, and seccomp filters—rather than a hardware barrier. Break those and you reach every other container on the node, the node’s credentials, and whatever the cluster will let that node do next. MITRE ATT&CK tracks the technique as Escape to Host, T1611.

The Three Routes Out

Configuration You Gave Away

Most escapes in the wild need no exploit at all, because the container was launched with the isolation already disabled. The usual culprits are a container run with --privileged, which grants nearly all capabilities and access to host devices; the Docker socket mounted into a workload, which is equivalent to handing over root on the host; a host path mount such as / or /etc; hostPID or hostNetwork enabled; and dangerous individual capabilities, particularly CAP_SYS_ADMIN. Each of these appears in legitimate tooling—monitoring agents, builders, and CI runners genuinely need some of them—which is exactly why attackers look for them first.

Runtime Vulnerabilities

The container runtime itself is a boundary, and it has failed several times. CVE-2019-5736 allowed a malicious container to overwrite the host runc binary by abusing a file descriptor reference to it, giving root on the host the next time a container was started. The Leaky Vessels set disclosed on 31 January 2024, including CVE-2024-21626, exposed a file descriptor leak in runc that allowed access to the host filesystem. CVE-2022-0492 showed that a control group feature could be abused for escape where CAP_SYS_ADMIN was available.

Kernel Flaws

Because the kernel is shared, a local privilege escalation vulnerability in it is effectively a container escape. CVE-2022-0185, a heap overflow in the filesystem context code, was demonstrated as an escape from an unprivileged container with user namespaces enabled. Dirty Pipe, CVE-2022-0847, allowed arbitrary overwriting of read-only files. Patching the host kernel is therefore container security work, not separate from it.

What Happens Next Is Usually Worse

Reaching the host is rarely the objective. In a managed Kubernetes cluster, the node holds a kubelet credential and, in most cloud deployments, an instance role or managed identity. An attacker on the node can read the service account tokens of every pod scheduled there, query the cloud metadata service for credentials—see our entry on the IMDS attack—and use them to pivot into the wider cloud account. The 2018 compromise of a Kubernetes console at Tesla, which attackers used to run cryptomining and reach stored cloud credentials, followed exactly this shape.

Controls That Actually Close the Door

Detecting an Attempt

Runtime detection is the backstop. Tools such as Falco, and the runtime modules of a cloud workload protection platform, flag the behaviours that precede an escape: a shell opening inside a production container, a process writing to /proc or /sys paths it has no reason to touch, a mount system call from inside a container, access to the runtime socket, and unexpected reads of the metadata endpoint. Alert on these, and make sure someone is available to act on the alert.

At Privia Security, we attempt these paths deliberately in client clusters through our cloud security services.

FAQ – Frequently Asked Questions

Is a Privileged Container Always Dangerous?

Treat it as root on the host, because that is effectively what it is. A privileged container holds nearly all Linux capabilities and can access host devices, which gives several straightforward paths to full host control. Some tooling genuinely requires it, so isolate those workloads on dedicated nodes with restricted access rather than allowing privileged pods anywhere in a general-purpose cluster.

Does Mounting the Docker Socket Really Grant Host Root?

Yes. A process that can talk to the Docker socket can ask the daemon to start a new privileged container with the host filesystem mounted, which is a complete escape in two commands. The same applies to the containerd socket. If a build or deployment job needs to create containers, use a rootless builder or a dedicated, isolated runner rather than passing the socket through.

Do Sandboxed Runtimes Eliminate the Risk?

They raise it substantially rather than eliminating it. gVisor intercepts system calls in a user-space kernel and Kata Containers runs each workload in a lightweight virtual machine, so a single kernel flaw no longer breaks the boundary. Both add some performance cost and compatibility constraints. For multi-tenant platforms running untrusted code, that trade is usually worth making.

How Would I Know an Escape Has Happened?

Look for host-level activity that no legitimate workload produces: unexpected processes on a node, new binaries written outside container filesystems, use of the kubelet credential from an unusual source, reads of service account tokens belonging to other pods, and metadata service queries from a process that has never made one. Runtime detection tooling covers most of this if the rules are tuned and watched.

Related Terms

You May Be Interested In These

What Is the Client Credentials Flow?

Cybersecurity Terms

17 November 2026

What Is the Client Credentials Flow?

Read More
What Happened in the MGM Resorts Attack?

Cybersecurity Terms

17 November 2026

What Happened in the MGM Resorts Attack?

Read More
What Is a Disaster Recovery Plan?

Cybersecurity Terms

17 November 2026

What Is a Disaster Recovery Plan?

Read More