Repository navigation
Description
Summary
The activity log records that an upstream server was patched but not what was patched. Every mutation payload field is dropped before the record is written, so the audit trail for the two config-mutating MCP tools is unusable for answering "what changed?".
Observed
A real upstream_servers patch that changed a server's Docker isolation settings. Activity-log detail drawer:
Request Arguments — 58 bytes:
{
"name": "gcore-mcp-server",
"operation": "patch"
}The actual call also carried isolation_json: {"enabled": true, "image": "ghcr.io/astral-sh/uv:python3.13-bookworm"}. It is nowhere in the record.
The Response Body happens to contain a changes diff for this operation, which is the only reason the change is recoverable at all — but that's a property of patch's response shape, not of the activity log. Operations whose response doesn't echo a diff leave no trace of the payload.
Root cause
internal/server/mcp.go:3268-3274:
// Build arguments map for activity logging (Spec 024)
args := map[string]interface{}{
"operation": operation,
}
if name := request.GetString("name", ""); name != "" {
args["name"] = name
}Only operation and name are captured. Dropped: isolation_json, env_json, args_json, headers_json, oauth_json, command, url, protocol, enabled, trust_mode, init_timeout, registry, id.
quarantine_security has the identical two-field builder at mcp.go:3393-3399.
This is inverted relative to the read-only tools: read_cache (mcp.go:5354) records key, offset and limit. The two tools that mutate security-relevant configuration are the two that record the least.
Second defect: the row shows no server
In the list view the row's Type is Internal Tool, Details is upstream_servers, and Server is - — even though the target server name is known and is already in args.
handleUpstreamServers passes targetServer: "" at every one of its ~10 emit sites, and EmitActivityInternalToolCall omits target_server entirely when empty. Consequences:
- the list row can't be read without opening the drawer
- filtering by Server misses these rows, so "show me everything that touched this server" silently omits every mutation applied to it
Passing the resolved server name as targetServer fixes both.
Suggested fix
- Record the full argument set for
upstream_serversandquarantine_security, with redaction —env_json,headers_json, andoauth_jsoncan carry secrets.internal/oauth/logging.goalready providesRedactEnvValues,RedactStringHeaders, andRedactSensitiveData; the machinery exists, it just isn't wired to this path. - Pass the target server name as
targetServerso the row renders and server-filtering works. - Consider recording the resolved before/after diff for
patch/updaterather than the raw request, which is what an operator actually wants and what the response already computes.
A test asserting that a patch activity record contains the mutated field names (and that a secret-bearing field is present-but-redacted, not absent) would keep this from regressing.
Found while diagnosing #1142: reconstructing what a patch actually did required reading the response diff, because the request record had already thrown the payload away.
Activity
Dumbris commentedon Aug 31, 2026
QA finding: the activity log already persists secrets in the clear — via the response
Reproduced on
main(0750fcd) against a scratch instance. The picture is worse than the original report: the request payload is dropped, and the response that is recorded leaks secrets.MCP call:
{"operation":"patch","name":"qa-inherit", "isolation_json":"{\"image\":\"node:22\"}", "env_json":"{\"QA_SECRET_TOKEN\":\"sk-super-secret-value-12345\"}"}Resulting activity record (
GET /api/v1/activity?type=internal_tool_call):Three things confirmed at once:
server_nameis null — as reported; the Server column and server-filter miss the row.handlePatchUpstreamputsconfigDiffinto the response and the response is what gets recorded. The same value is also returned to the MCP caller in the clear.So the store is already a secret sink today. That reframes the fix:
configDiffmust be redacted before it enters either the MCP response or the activity record. Env values, headers, and OAuth secrets all flow throughMergeServerConfig's diff.from/toshape should keep the key and drop the value ("QA_SECRET_TOKEN": "***"), so an operator can still see which credential changed.Raising this to a security-relevant defect rather than a pure observability gap.
fix(server): record redacted mutation payloads and target server in t…
fix(security): bind the argv unmask, and close the six sibling gaps the
fix(security): mask shared servers on the server edition's per-user door