Home/ Blog/ Security news/ Article
Blog · Security news

A rigged container image can seize root on the host running Docker's AI agent tools

CVE-2026-55887 lets a malicious container image escape Docker's MCP Gateway and run code as root on the host. Rated 8.7. Affected 0.21.0 to 0.42.1; fixed in

An ajar shipping container standing apart from neat rows on a dockyard at dusk

If you use Docker's MCP Gateway to run the small tool programs that AI assistants call (the servers behind the Model Context Protocol, or MCP), a single malicious container image can do far more than misbehave inside its sandbox. It can break out of the container and take over the host. Docker disclosed the flaw on June 24 as GHSA-r2xf-7jw5-pjg6, tracked as CVE-2026-55887 and rated 8.7 out of 10. The Zero Day Initiative, whose researcher reported it, published its own writeup as ZDI-26-363 (it scores the flaw 8.6). The fix shipped in version 0.42.2. If you run the gateway, updating is this week's work, and the reason is worth understanding because it is the kind of trust mistake that will keep happening as AI tooling grows.

What the MCP Gateway is, and why this reaches the host

Docker's MCP Gateway is the docker mcp command-line plugin, and the MCP Toolkit is built on top of it. It is how a growing number of teams run MCP servers: the small tool programs an AI assistant calls to read files, query a database, or hit an API. Each server runs in its own container, and the gateway is the thing that decides how to launch each one. To make those decisions, it reads metadata that the image carries with it.

That last part is the soft spot. A container is supposed to be a boundary, and the host is supposed to be in charge of how a container starts. Here, the image got to influence how the host launched it.

The bug: a label that turns into command-line arguments

Every OCI image (the standard format Docker images use) can carry labels, which are simple metadata strings baked into the image by whoever built it. The gateway read one specific label, io.docker.server.metadata, and parsed it as YAML. Per Docker's advisory, that parsed data was loaded straight into the structure the gateway uses to launch a server, and crucially that structure included fields the runtime obeys: which volumes to mount, which user to run as, what command to run, and which extra hosts to add. Those values then flowed into the docker run invocation with nothing checking them along the way.

In plain terms: the settings that decide what a container can mount, which user it runs as, and what it executes were lifted from a string an attacker controls and handed to the command that starts the container. So a hostile image author can set that label so the host mounts its entire filesystem into the container and runs it as the root user. From there, code in the container is code on the host, running as root. Docker classifies it as CWE-88, argument injection, and ZDI describes the root cause as a user-controlled string reaching a system-call argument without being validated first.

The CVE record is blunt about the payoff: an attacker whose image a victim references can mount the host's filesystem, run as user ID zero, and execute code of their choosing on the host itself.

What it takes to be hit

This is not a worm. The CVSS breakdown records that user interaction is required and that the attack is delivered locally rather than over the network. The trigger is the victim referencing the malicious image: either pointing the gateway at it directly through a docker:// reference, or having a catalog that pulls a snapshot from it. No password is needed on the attacker's side, and no prompt warns the victim, because to the gateway this looks like a normal image with normal metadata.

The exposed versions are 0.21.0 through 0.42.1. If your gateway falls in that range and it ever launches a server image you did not build yourself, you are in scope. As MCP catalogs grow and people pull tool servers the way they pull npm packages, "an image someone else built" stops being an edge case and becomes the normal case.

What to do this week

Three things, in order:

  • Update the gateway to 0.42.2 or later. In the patched build the parser reads only the descriptive parts of the label and ignores anything that would set runtime options, so the metadata can no longer steer docker run. This is the real fix; everything else is containment.

  • Treat MCP server images like any third-party dependency. Run servers only from images you trust or have reviewed, and be deliberate about what catalogs your gateway is allowed to pull from. The supply-chain question (who built this image, and why do I trust it) is the same one you already ask of packages and base images.

  • Hunt for the outcome, not just the version. The signature of exploitation is a container doing something a tool server never should: running as root, bind-mounting the host root (/), or mounting the Docker socket (/var/run/docker.sock). Audit running and recent containers on any host that runs the gateway for those mounts and that user, and alert on them going forward. A host that flags any container mounting the host filesystem or the Docker socket it was not meant to touch will catch this class of escape even when the specific bug is new.

The pattern worth remembering

The interesting thing here is not one parser bug. It is that the boundary failed in the direction nobody was watching. Everyone treats the container as the thing to be contained; almost nobody treats the image's metadata as untrusted input that can reach back and reconfigure the host. AI tooling is now generating exactly this shape of risk at speed: agents pulling and running tool servers, catalogs aggregating images from many authors, and convenience layers that read "helpful" metadata to set things up automatically. Each one is a place where data from an outside author quietly becomes a decision the host makes. The fix in 0.42.2 closes this instance. The habit it should leave you with is to ask, of every new AI integration, which strings it trusts and what those strings are allowed to control.

Topics

Frequently asked questions

What is CVE-2026-55887?

CVE-2026-55887 is an argument-injection flaw in Docker's MCP Gateway (the docker mcp CLI plugin behind the MCP Toolkit). The gateway read a YAML image label and passed runtime-control fields straight to the docker run command, so a malicious image could inject arguments that mount the host filesystem and run as root. Docker disclosed it on June 24, 2026 as GHSA-r2xf-7jw5-pjg6, rated 8.7, and the Zero Day Initiative published it as ZDI-26-363 (scored 8.6).

Which versions are affected and how do I fix it?

Versions 0.21.0 through 0.42.1 of the Docker MCP Gateway are affected. The fix is in version 0.42.2, which restricts the image label to descriptive fields and no longer lets it set runtime options. Upgrade to 0.42.2 or later. There is no configuration-only mitigation that fully closes the flaw, so patching is the real fix.

How does the attack actually work?

The gateway parsed the io.docker.server.metadata OCI image label as YAML and unmarshalled it directly into a struct with runtime-control fields like Volumes, User, Command, and ExtraHosts, then handed those to docker run without validation. An attacker who authors an image can set those fields so the host mounts its full filesystem into the container and runs it as the root user, turning code in the container into code on the host. It is classified as CWE-88, argument injection.

Does an attacker need access to my system to exploit this?

No direct access, but the victim has to reference the malicious image. The CVSS vector marks user interaction as required: the gateway must be pointed at the attacker's image through a docker:// reference, or a catalog the victim uses must pull a snapshot from it. There is no warning, because to the gateway the image looks ordinary. That makes running only trusted images, and controlling which catalogs the gateway pulls from, a meaningful defense.

Is CVE-2026-55887 being actively exploited?

There is no public report of in-the-wild exploitation as of the June 24, 2026 disclosure, and it is not on CISA's known-exploited list. The flaw was reported to Docker in May 2026 and the technical details are now public alongside the patch, so the prudent assumption is that exploitation interest follows the disclosure. Update to 0.42.2 rather than waiting for proof of attacks.

Ready to meet the Guardians?

Deploys fast - agentless for monitoring and cloud, a lightweight agent for deep endpoint security. Just Suriq, standing watch.