Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-r2xf-7jw5-pjg6

Опубликовано: 18 июн. 2026
Источник: github
Github: Прошло ревью
CVSS4: 8.7

Описание

Docker MCP Gateway: Argument injection via OCI image label YAML

Summary

A maliciously crafted OCI image label can inject arbitrary arguments into the docker run command line constructed by the MCP Gateway. An attacker who controls an image that the victim references via docker://, or that the victim's catalog pulls a snapshot from, can mount the host filesystem, run as UID 0, and execute arbitrary code on the host.

Details

The io.docker.server.metadata OCI image label is YAML-unmarshalled directly into the wide catalog.Server struct, which carries runtime-shaping fields (Volumes, User, Command, ExtraHosts, AllowHosts, DisableNetwork, Env, Remote, SSEEndpoint, OAuth,Secrets, LongLived, Policy) alongside descriptive fields. Every runtime field carries a YAML tag, so the unmarshal mass-assigns from the attacker-controlled label content; only Image is overwritten afterwards. The gateway's container-launch code then appends those fields verbatim as docker run flags (-v, -u, --add-host) with no allowlist or origin check, and execs docker with the resulting argv.

Impact

A malicious image author can achieve arbitrary code execution as UID 0 on the host of a victim running an affected version of MCP Gateway. Attacker-injected -v /:/host, -u root, and -v /var/run/docker.sock:/var/run/docker.sock arguments reach the docker run invocation that launches the MCP server container, giving the attacker full host filesystem access and root execution. The container/host trust boundary is bypassed at container-creation time, so the --security-opt no-new-privileges flag the gateway applies provides no protection: no in-container privilege escalation is needed.

Patches

The OCI image-label parser now only populates descriptive fields from the image label, which excludes fields that control the container runtime.

Credit

This issue was reported by Jabr Al-Otaibi @ DarkCov working with TrendAI Zero Day Initiative

Пакеты

Наименование

github.com/docker/mcp-gateway

go
Затронутые версииВерсия исправления

>= 0.21.0, < 0.42.2

0.42.2

EPSS

Процентиль: 10%
0.00199
Низкий

8.7 High

CVSS4

Дефекты

CWE-88

Связанные уязвимости

nvd
7 дней назад

MCP Gateway allows easy and secure running and deployment of MCP servers. From 0.21.0 until 0.42.2, Docker MCP Gateway YAML-unmarshalled the attacker-controlled io.docker.server.metadata OCI image label into the broad catalog.Server structure for direct docker:// references and catalog snapshot imports in pkg/oci/self_contained.go and pkg/workingset/workingset.go. Runtime-shaping fields including Volumes, User, and ExtraHosts were then appended to the docker run argument vector without an origin allowlist, allowing a malicious image author to request host filesystem or Docker socket mounts and UID 0 execution when a victim selected or pulled the image. This container-creation-time boundary bypass can execute arbitrary code on the host and is not prevented by no-new-privileges because no in-container privilege escalation is required. This issue is fixed in version 0.42.2.

EPSS

Процентиль: 10%
0.00199
Низкий

8.7 High

CVSS4

Дефекты

CWE-88