ToolHive: containerized MCP servers can reach host services via host.docker.internal, enabling lateral movement
CVE-2026-58197 (GitHub advisory GHSA-qg2g-g9w3-m5h8) is a high-severity vulnerability with a CVSS 3.1 base score of 8.8, classed as Improper Access Control (CWE-284), in github.com/stacklok/toolhive (Go). Affected versions: < 0.30.1. It is fixed in 0.30.1.
Published 18 Sept 2026Updated 18 Sept 2026
- CVE ID
- CVE-2026-58197
- GHSA ID
- GHSA-qg2g-g9w3-m5h8
- EPSS
- 0.36%higher than 29% of CVEs
- KEV status
- Not in KEV
- Published
- 18 Sept 2026
- Updated
- 18 Sept 2026
- Ecosystem
- Go
- Assigned by (CNA)
- GitHub_M
Summary
Source: OSV (GitHub advisory)
A containerized MCP server running with the default network permission profile (insecure_allow_all: true) can reach host-local services via host.docker.internal. This includes the ToolHive API itself, other ToolHive-managed MCP server proxies, and any other service listening on the host's localhost. Combined with the unauthenticated ToolHive API and MCP proxy endpoints, this enables a compromised or malicious MCP server to perform lateral movement without any container escape.
Severity
High — This bypasses the container isolation model that is ToolHive's core security value proposition.
Reproduction
All tests performed from inside the filesystem MCP container (docker.io/mcp/filesystem:latest), started with default settings via thv run filesystem -- /tmp.
1. Container can reach the ToolHive control plane MCP endpoint
$ docker exec <container_id> wget -qO- \
--header="Content-Type: application/json" \
--header="Accept: application/json" \
--post-data='{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"evil-mcp","version":"1.0"}},"id":1}' \
http://host.docker.internal:50444/mcp
Result: Full MCP handshake succeeds:
{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-03-26","capabilities":{"logging":{},"tools":{}},"serverInfo":{"name":"toolhive-mcp","version":"v0.9.3"}}}
2. Container can connect to another MCP server's proxy and call its tools
$ docker exec <container_id> wget -qO- \
--header="Content-Type: application/json" \
--header="Accept: application/json" \
--post-data='{"jsonrpc":"2.0","method":"tools/list","params":{},"id":2}' \
http://host.docker.internal:64965/mcp
Result: Returns the full tool list of the target MCP server (read_file, write_file, edit_file, move_file, etc.), and tools can be called:
{"jsonrpc":"2.0","id":3,"result":{"content":[{"text":"Allowed directories:\n/tmp","type":"text"}]}}
3. Container can reach other host services
# Kubernetes API
$ docker exec <container_id> wget -qO- --no-check-certificate https://host.docker.internal:6443/version
{"major":"1","minor":"34","gitVersion":"v1.34.1"...}
# Ollama LLM API
$ docker exec <container_id> wget -qO- http://host.docker.internal:11434/api/tags
{"models":[{"name":"kimi-k2:1t-cloud"...}]}
Attack Scenarios
Scenario 1: Malicious MCP server pivots to privileged native MCP tools
Many users run native (non-containerized) MCP servers like Desktop Commander, terminal servers, or custom tools that have execute_command, write_file, or shell capabilities with full host access. These typically listen on localhost ports. A malicious containerized MCP server can:
- Port-scan
host.docker.internalto discover listening services - Attempt MCP handshakes on discovered ports
- Call privileged tools (e.g.,
execute_command("rm -rf /")orwrite_file("/etc/crontab", "..."))
This achieves full host compromise without any container escape vulnerability.
Scenario 2: Compromised MCP server manipulates ToolHive itself
Via the unauthenticated ToolHive MCP endpoint on port 50444, a compromised container could potentially:
- List and stop other running MCP servers (denial of service)
- Start new MCP servers with attacker-controlled images
- Modify configurations
Scenario 3: Data exfiltration via cross-MCP-server access
A low-privilege MCP server (e.g., sequentialthinking with no file mounts) could reach the filesystem server's proxy and call read_file to access files it was never authorized to see.
Scenario 4: LLM model theft / abuse
As demonstrated, the container can reach Ollama's API and could enumerate models, run inference, or exfiltrate model weights from self-hosted LLMs.
Root Causes
insecure_allow_all: trueas default — permits outbound connections to any destination includinghost.docker.internal- No authentication on ToolHive API / MCP proxies — any client that can reach the port can interact fully
- Docker's
host.docker.internalDNS — resolves to the host machine, bypassing localhost-only binding assumptions
Suggested Mitigations
Short-term
- Block
host.docker.internaland172.17.0.1(Docker gateway) in container networking by default, even wheninsecure_allow_allis enabled. These should require explicit opt-in. - Add authentication to MCP proxy endpoints — even a shared secret or token per session would prevent cross-container lateral movement.
Medium-term
- Network policy per container — ToolHive already has the
permission_profileinfrastructure. Add support for explicit allow-lists rather than just the binary none/all choice. - Isolate container networks — run each MCP server in its own Docker network with no access to the Docker bridge gateway.
Long-term
- Mutual TLS or token-based auth between ToolHive proxy and containers, so even if network access exists, unauthorized MCP calls are rejected.
- Audit logging — log all MCP tool calls with source identification so lateral movement attempts are visible.
Environment
- ToolHive v0.9.3 (macOS desktop app, Docker runtime)
- Docker Desktop for Mac (host.docker.internal enabled by default)
- Tested with
docker.io/mcp/filesystem:latest
Technical details
Source: GitHub Advisory Database
CVSS:3.1/AV:A/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:HHigh8.8Base score from GitHub Advisory Database
- Attack Vector AV
- Adjacent
- Attack Complexity AC
- Low
- Privileges Required PR
- None
- User Interaction UI
- Required
- Scope S
- Changed
- Confidentiality C
- High
- Integrity I
- High
- Availability A
- High
CISA SSVC decision points
- Exploitation
- poc
- Proof-of-concept code is public
- Automatable
- no
- Needs manual steps per target
- Technical impact
- total
- Full control of the affected system
CISA Coordinator assessment (SSVC 2.0.3) via CVE.org.
Affected packages
Source: OSV (GitHub advisory)
- github.com/stacklok/toolhiveGo
pkg:golang/github.com/stacklok/toolhive- Affected versions
- < 0.30.1
- Fixed in
- 0.30.1
| Package | Affected versions | Fixed in |
|---|---|---|
github.com/stacklok/toolhive Go pkg:golang/github.com/stacklok/toolhive |
|
|
Fix
Source: OSV (GitHub advisory)
Fix available
Upgrade to 0.30.1 or later.
Patch commits
fix: make network isolation mode explicit instead of inferred (#2469)
+1565 −993 across 20 files
- common/api/generated/types.gen.ts+27 −0
- common/api/openapi.json+15 −0
- renderer/src/common/lib/form-schema-mcp.ts+34 −4
- renderer/src/features/mcp-servers/components/__tests__/network-isolation-tab-content.test.tsx+0 −407
- renderer/src/features/mcp-servers/components/local-mcp/__tests__/dialog-form-local-mcp.test.tsx+28 −32
- renderer/src/features/mcp-servers/components/local-mcp/dialog-form-local-mcp.tsx+30 −11
- renderer/src/features/mcp-servers/components/network-isolation-tab-content.tsx+0 −166
- renderer/src/features/mcp-servers/hooks/__tests__/use-update-server.test.tsx+6 −3
- and 12 more files
Default network isolation to on for local MCP servers (#5583)
+63 −16 across 11 files
- cmd/thv/app/run_flags.go+2 −2
- docs/cli/thv_run.md+1 −1
- docs/server/docs.go+2 −2
- docs/server/swagger.json+2 −2
- docs/server/swagger.yaml+8 −4
- pkg/api/v1/workload_service.go+1 −1
- pkg/api/v1/workload_types.go+13 −2
- pkg/api/v1/workloads_types_test.go+26 −1
- and 3 more files
Release commits
The commits each fixed release tag points at. They usually bump the version rather than contain the fix itself.
Vulnerability intelligence
Root cause analysis
Vulnerable functions
References
Fixes 4
Advisories 4
Package 1
Credits
- xxradarreporter
- ChrisJBurnsremediation developer
- JAORMXremediation reviewer
- jhrozekanalyst
- kantordremediation developer
- eleftheriasremediation developer
Questions about CVE-2026-58197
- What is the GHSA ID for CVE-2026-58197?
- GitHub tracks CVE-2026-58197 as GHSA-qg2g-g9w3-m5h8.
- What is the CVSS score of CVE-2026-58197?
- CVE-2026-58197 has a CVSS 3.1 base score of 8.8 (High), vector CVSS:3.1/AV:A/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H.
- Which versions are affected by CVE-2026-58197?
- github.com/stacklok/toolhive (Go): < 0.30.1.
- How do I fix CVE-2026-58197?
- Upgrade to 0.30.1 or later. The fix is in commits 968182d and d8f40cb and pull requests #2469 and #5583.
- What is the Package URL (PURL) for CVE-2026-58197?
- The affected package's PURL is pkg:golang/github.com/stacklok/toolhive.
- Is CVE-2026-58197 exploited in the wild?
- CISA's Known Exploited Vulnerabilities catalog doesn't list CVE-2026-58197. That means no confirmed exploitation has been catalogued, not that it is safe to leave unpatched. CISA's SSVC assessment rates exploitation as "poc". EPSS estimates a 0.36% chance of exploitation in the next 30 days, higher than 29% of CVEs.
Data sources
Upstream records
- OSV (GitHub advisory)LoadedRaw JSON
- GitHub Advisory DatabaseLoadedRaw JSON
- OSV (CVE record)LoadedRaw JSON
- CVE.orgLoaded
- CISA KEV catalogLoaded
Fetched 5 days ago (8 Oct 2026, 22:32 UTC). Records refresh automatically after 24 hours.
Where each part of this page came from
- Title and description
- OSV (GitHub advisory)
- Severity score
- GitHub Advisory Database
- Weakness (CWE)
- GitHub Advisory Database
- Affected packages
- OSV (GitHub advisory)
- Fix
- OSV (GitHub advisory)
- References
- Computed by CVEminer
- SSVC
- CVE.org
- KEV status
- CISA KEV catalog
- EPSS
- GitHub Advisory Database
OSV and GitHub Advisory Database content is licensed CC BY 4.0. Values marked as computed or derived were calculated by CVEminer from the upstream data.