Skip to main content
Menu
Advisories

Unvalidated config-driven bind mount via dynamic tools

GHSA-MQQ5-QH4G-2G8GPublished Updated GitHub

Description

The dynamic management tools mcp-add and mcp-config-set are exposed with no authorization gate, and config supplied to them is validated only against the catalog server's JSON schema — not against the values. At run time the catalog Spec.Volumes templates are expanded with that config and appended as docker -v bind mounts with no host-path allowlist, so an attacker-controlled value can mount a sensitive host path (e.g. the Docker socket) into a spawned container — yielding code execution as root on the host.

Details

  • mcp-add / mcp-config-set are registered with no access-control check; configSetHandler validates config only against the server's JSON schema.
  • At run time, runClientContainer expands Spec.Volumes and appends each as a docker -v bind mount; the only filter (isSafeFlagValue) just rejects values starting with -, so /var/run/docker.sock passes. The same gap exists in runToolContainer (volumes from call arguments).

Impact

Mounting a sensitive host path (such as the Docker socket) into a spawned container, combined with the gateway's Docker authority, gives code execution as root on the host.

Preconditions

  • --dynamic-tools enabled (off by default).
  • Gateway has Docker API authority (mounted /var/run/docker.sock, Docker API socket, or privileged Docker-in-Docker).

Workarounds

  • Run without --dynamic-tools (the default).
  • Do not grant the gateway Docker socket / API access when dynamic tools are enabled.
  • Keep authentication enabled.

References

Affected versions

References

GitHub · docker/mcp-gateway