Unvalidated config-driven bind mount via dynamic tools
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-setare registered with no access-control check;configSetHandlervalidates config only against the server's JSON schema.- At run time,
runClientContainerexpandsSpec.Volumesand appends each as adocker -vbind mount; the only filter (isSafeFlagValue) just rejects values starting with-, so/var/run/docker.sockpasses. The same gap exists inrunToolContainer(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-toolsenabled (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.