AIDEFEND in Action AIA-0177 Validated Research

ToolHive: A Default MCP Server Container Reached the Host's Control Plane and Another Server's File Tools

ToolHive runs services that give AI assistants access to tools. A researcher found that a service started with default settings on ToolHive 0.9.3 for macOS could connect back to the computer running Docker. Without credentials, it reached ToolHive's management service and another server's file tools. The test did not show a file being read or changed. ToolHive CLI 0.30.1 and Studio 0.38.0 enable network isolation by default for local services.

Authentication BypassRuntime IsolationIdentity & AccessMCP SecurityAI Infrastructure
4 applicable AIDEFEND defenses
Source: ToolHive: containerized MCP servers can reach host services via host.docker.internal, enabling lateral movement (GHSA-qg2g-g9w3-m5h8) 
Authors: Philippe Bogaerts (reporter); Stacklok ToolHive maintainers
Original article: Jul 28, 2026

Threat Analysis

  • What ToolHive is supposed to contain. ToolHive runs each MCP server in its own container behind a proxy on the host; AI clients talk to the proxy on 127.0.0.1, and a control-plane service starts, stops and configures the servers. The container is meant to keep an untrusted, often third-party server away from the rest of the machine. Before the fix, local containers ran without network isolation under a default permission profile with insecure_allow_all: true, which allows connections to any destination, and the desktop app (Studio) sent network_isolation as false before 0.38.0. The Kubernetes operator, which runs MCP servers in a cluster, does not use this setting.
  • How the reproduction crossed it. The reporter tested ToolHive v0.9.3 through the macOS desktop app with Docker Desktop for Mac. A legitimate filesystem server started with default settings stood in for a hostile one, and the reporter sent requests from inside its container. Inside a container, host.docker.internal resolves to the host, and the report states that this bypasses the assumption that services bound only to localhost are unreachable. The container then completed an MCP handshake with ToolHive's control-plane endpoint (toolhive-mcp v0.9.3 on port 50444), listed another server's tools through its proxy on port 64965 (read_file, write_file, edit_file, move_file and more) and received the result of one tool call, read the version of a Kubernetes API server on port 6443, and listed the models of an Ollama instance (a tool for running LLMs locally) on port 11434. None of these services asked for a credential, and nothing escaped the container.
  • What the control plane could have done. The report stops at the handshake. In the v0.9.3 source, that endpoint is the embedded MCP server started by thv serve --experimental-mcp, and it registers tools that run, stop and remove servers, return server logs, and list or set secrets; the desktop app of that period launched it on 127.0.0.1. The reporter's scenarios add stopping other servers, starting servers from attacker-chosen images, reading files through another server's read_file, and calling native MCP servers that have shell tools. These are possibilities derived from the access shown, not demonstrated results.
  • Where the evidence stands. The maintainers published the report as GitHub security advisory GHSA-qg2g-g9w3-m5h8 on 28 July 2026, and CVE-2026-58197 followed on 18 September with a CVSS 3.1 score of 8.8. Its vector marks the attack as coming from an adjacent network and requiring user interaction, because the user must first run the malicious or compromised server. In the CVE record, the US Cybersecurity and Infrastructure Security Agency (CISA) rates exploitation as proof of concept, and there is currently no public evidence that this attack path has been used in a real attack.
  • What the fix changed, and what it did not. PR 5583 made isolation the default for thv run and the REST API in CLI 0.30.1 (23 June 2026): the container gets an internal network, and an egress-proxy container blocks host gateway addresses even under the allow-all profile. Studio 0.38.0 (16 July 2026) stopped overriding that default and by then also reached the ToolHive API through a local socket and no longer started the control-plane MCP endpoint. Running servers keep their old networking until restarted, and --isolate-network=false, --network host or --allow-docker-gateway reopen the host. Proxies without OIDC (OpenID Connect, a standard in which an identity provider issues tokens that prove who is calling) still accept unauthenticated requests, a default the maintainers keep deliberately.

Applicable AIDEFEND Defenses (4)

AID-I-001.004
Sandbox Network Egress Restrictions
Very High
An MCP server's container should not be able to connect to the machine it runs on. ToolHive's isolation puts the container on an internal Docker network with no default route and sends outbound traffic through a separate egress-proxy container that denies host gateway addresses such as host.docker.internal, even under the allow-all profile; the server cannot change those rules from inside. With it in place, this connection fails and none of the four branches can start. --isolate-network=false and --network host remove the protection, and --allow-docker-gateway reopens every host port. Verify from inside each running container: requests to host.docker.internal on the ToolHive and Ollama ports must fail.
AID-H-021.004
Control-Plane & Oversight-Surface Isolation
Very High
The service that starts, stops and configures MCP servers must not be reachable from the servers it manages. In the test it was: the desktop app ran the control-plane MCP endpoint on 127.0.0.1, and in the v0.9.3 source that endpoint can run, stop and remove servers, read their logs and set secrets without checking the caller. Serve the ToolHive API only on a local socket that no container mounts, as Studio 0.38.0 does, or require OIDC tokens on thv serve, and keep the experimental MCP endpoint off. A managed server then has neither a route nor a credential. Verify that a handshake attempted from inside a running container fails.
AID-H-003.010
Deployed AI Software Vulnerability Remediation Lifecycle
High
Upgrading changes what happens at launch: from CLI 0.30.1, thv run and the REST API isolate local servers unless told otherwise, and Studio 0.38.0 stops sending network_isolation as false. Servers already running keep their old networking until restarted, the release adds no authentication to the proxies, and opt-outs still reopen the host, so a probe from inside the container remains the proof. On each machine, read back the installed versions, restart every MCP server, and confirm that the ToolHive API reports network_isolation as true for each workload.
AID-H-034.002
MCP Server OAuth Resource Boundary & Delegation Safety
High
Without an OIDC issuer, each ToolHive proxy gives every request a synthetic local-user identity and checks no token, a default the maintainers keep on purpose. Setting --oidc-issuer and --oidc-audience for each server makes its proxy validate issuer, audience and expiry on every request, so code in another container that holds no token gets an authentication failure instead of a tool list. Use a distinct audience per server, because this review did not establish whether a proxy forwards the client's token to its own server. The flags are documented for the CLI only. A host process sending tools/list without a token must be refused.

What Defenders Should Do Now

  • Inventory, upgrade, then restart. On every machine that runs ToolHive, read the installed CLI and Studio versions. If the CLI is older than 0.30.1 or Studio older than 0.38.0, upgrade, then stop and start every MCP server, because running servers keep their old network settings until they are relaunched. If an upgrade has to wait, stop servers you have not reviewed, turn on network isolation for the rest with a permission profile that lists only the hosts each one needs, and do not rely on that setting until the next check passes.
  • Prove that the container cannot reach the host. From inside each running MCP server container, send requests to host.docker.internal on the ToolHive proxy and API ports and on host services such as Ollama's port 11434. The check passes only if every request fails while the destinations the server legitimately needs still answer.
  • Review every exception. List servers started with --isolate-network=false, --network host or --allow-docker-gateway, and Studio servers set to host networking or allowed host access. Gateway access opens the host on every port, not only the one a server needs, so each exception needs an owner and a reason, or it should be removed.
  • Keep the control plane away from the servers it manages. Run thv serve on a local socket that no container mounts, or with OIDC token validation, and leave the experimental control-plane MCP endpoint off. From inside a container, an MCP initialize request to the control plane must fail.
  • Require tokens at the proxies. Where CLI deployments can use an identity provider, set --oidc-issuer and a distinct --oidc-audience for each server, then confirm from a host process that tools/list without a token is refused.

Conclusion

AIDEFEND  identifies three places to intervene: block container connections to the host, keep the management service separate, and check credentials at each tool proxy. After updating ToolHive, restart existing services and verify that their containers can no longer reach the host's management interface.

Last updated: