• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 23654603071
65%

Build:
DEFAULT BRANCH: main
Ran 27 Mar 2026 03:47PM UTC
Jobs 1
Files 584
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Mar 2026 03:42PM UTC coverage: 65.421% (+0.04%) from 65.382%
23654603071

push

github

web-flow
Block Docker gateway addresses in egress proxy by default (#4395)

## Why

Containerized MCP servers can reach host services via `host.docker.internal`,
`gateway.docker.internal`, and the Docker bridge gateway IP (`172.17.0.1`).
This enables lateral movement from a compromised or malicious MCP server to
services running on the host, bypassing the container network boundary.

The existing `insecure_allow_all` permission flag does not protect against this:
users enabling it intend to open general internet access, not necessarily host
access. These are distinct threat surfaces and warrant separate opt-ins.

## What changed

The Squid egress proxy config now emits ACL deny rules for the three Docker
gateway addresses **before** any allow rules. Squid evaluates access control
in first-match-wins order, so placing the deny first ensures it cannot be
bypassed by a subsequent `http_access allow all`.

A new `--allow-docker-gateway` CLI flag (default `false`) provides an explicit
opt-in for the small number of MCP servers that legitimately need host access.
The flag threads through the full call chain:

```
--allow-docker-gateway (run_flags.go)
  → RunConfig.AllowDockerGateway (config.go)
  → runtime.Setup() (setup.go)
  → DeployWorkloadOptions.AllowDockerGateway (types.go)
  → createEgressSquidContainer() (client.go)
  → createTempEgressSquidConf() (squid.go)
```

Generated Squid config with default settings (blocking active):

```squid
acl docker_gateway_hosts dstdomain host.docker.internal gateway.docker.internal
acl docker_gateway_ip dst 172.17.0.1
http_access deny docker_gateway_hosts
http_access deny docker_gateway_ip

http_access allow all   # (or ACL-based allow rules)
http_access deny all
```

22 of 48 new or added lines in 6 files covered. (45.83%)

4 existing lines in 2 files now uncovered.

52495 of 80242 relevant lines covered (65.42%)

65.38 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
26.54
0.27% cmd/thv/app/run_flags.go
1
76.95
1.62% pkg/container/docker/squid.go
1
5.94
-0.06% pkg/runtime/setup.go
5
74.27
-0.52% pkg/runner/config_builder.go
18
53.96
-0.7% pkg/container/docker/client.go

Uncovered Existing Lines

Lines Coverage ∆ File
1
53.96
-0.7% pkg/container/docker/client.go
3
79.38
-0.77% pkg/transport/proxy/httpsse/http_proxy.go
Jobs
ID Job ID Ran Files Coverage
1 23654603071.1 27 Mar 2026 03:47PM UTC 584
65.42
GitHub Action Run
Source Files on build 23654603071
  • Tree
  • List 584
  • Changed 16
  • Source Changed 9
  • Coverage Changed 16
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23654603071
  • 887b39cd on github
  • Prev Build on main (#23654326109)
  • Next Build on main (#23661423359)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc