Skip to content

isolation.enabled: nil (inherit global) is reported as false, so isolated servers display as unisolated #1142

Closed

Description

@Dumbris

Corrected 2026-08-31. This issue originally claimed that upstream_servers patch disabled isolation. That was wrong — verified below. The persisted config is correct; the reporting is not. Title and body rewritten to the actual defect.

Summary

IsolationConfig.IsEnabled() returns false when Enabled is nil, but nil means "inherit global" — as the field's own comment says, and as the spawn path implements. Every read surface (REST API, CLI, Web UI, tray) therefore reports Docker isolation as disabled for servers that are actually running isolated.

The contradiction

internal/config/config.go:801 — the field is explicitly tri-state:

Enabled *bool `json:"enabled,omitempty"` // nil = inherit global

internal/config/config.go:833 — but the accessor collapses inherit to off:

func (ic *IsolationConfig) IsEnabled() bool {
	if ic == nil || ic.Enabled == nil {
		return false   // <-- "inherit global" reported as "disabled"
	}
	return *ic.Enabled
}

internal/upstream/core/isolation.go:219 — meanwhile the spawn path gets it right, downgrading only on an explicit false:

// (3) Global isolation active: honor a per-server bool opt-out.
if serverConfig.Isolation != nil &&
	serverConfig.Isolation.Enabled != nil && !*serverConfig.Isolation.Enabled {
	return config.IsolationModeNone
}
return globalMode

So with global isolation on and a per-server isolation object that has an image but no enabled, the server is containerized while every UI says isolation is off.

Verification

Isolation object built by unmarshalling {"image": "…bookworm"} and merged onto a server with no prior isolation:

after unmarshal: Enabled=<nil> (nil=true) Image="ghcr.io/astral-sh/uv:python3.13-bookworm"
after merge:     Enabled=<nil> (nil=true) Image="ghcr.io/astral-sh/uv:python3.13-bookworm"
IsEnabled()=false          <-- the bug
marshalled: {"image":"ghcr.io/astral-sh/uv:python3.13-bookworm"}

MergeServerConfig preserves the tri-state correctly and the persisted JSON has no enabled key. Confirmed against the live process too — docker ps shows the container running:

ghcr.io/astral-sh/uv:python3.13-bookworm   "uvx --from gcore-mc…"

while mcpproxy upstream list reported "isolation": {"enabled": false, …} for that same server.

Blast radius

internal/contracts/converters.go:73 feeds IsEnabled() into contracts.IsolationConfig.Enabled, which is a plain bool — the tri-state is destroyed at the API boundary, so no downstream consumer can recover it. Same flattening at runtime.go:2434 and mcp.go:3864.

Consequences:

  1. Operators misread their own security posture — the UI says a server is unisolated when it is isolated. For a feature whose entire purpose is containment, the status display being wrong in the reassuring-to-scary direction is bad; being wrong at all is worse than not showing it.
  2. Likely write-back corruption. The Web UI / tray populate an isolation form from this flattened false. Saving any other isolation field (say, the image) would submit enabled: false — turning a display artifact into a real, persisted opt-out that genuinely disables isolation. The REST writer (httpapi/server.go:1783 IsolationRequest.toConfig) preserves nil correctly, so the corruption would come from the client sending an explicit false it never meant. Worth confirming in frontend/src as part of the fix.

Suggested fix

The reported value must be the effective mode, which needs the global config — something ConvertServerConfig doesn't currently receive. Options:

  • (a) Have the read surfaces report the resolved mode from IsolationManager.ResolveMode(server), which is already the single source of truth for the spawn decision. The payload already carries an isolation_defaults block, so there is precedent for resolving global context on the read path.
  • (b) Make contracts.IsolationConfig.Enabled a *bool passthrough and let clients resolve it — preserves information but is an API break and pushes the precedence logic into every client.
  • (c) Keep Enabled as the raw override and add an explicit effective_enabled (or effective_mode) field. Most informative, no API break, and makes "inherit" visible as its own state rather than a guess.

(c) or (a) preferred. Whichever is chosen, IsEnabled()'s nil case should stop meaning "false" — rename it to IsExplicitlyEnabled(), or delete it in favour of the resolver, so the next caller can't reintroduce the same flattening.

A test asserting that a server with isolation:{image:…} and global isolation on reports as isolated on every read surface (contracts, CLI JSON, /api/v1/servers) would lock this down.

Related: #1146 — found while auditing the same patch operation.

Activity

  1. added
    kind/bug
    kind/security
    area/docker
    priority/high
    on Aug 31, 2026
  2. changed the title [-]upstream_servers patch silently disables Docker isolation when creating the isolation object[/-] [+]isolation.enabled: nil (inherit global) is reported as false, so isolated servers display as unisolated[/+] on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/dockerkind/bugkind/securitypriority/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions