You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
reveal_secret_headers unmasks upstream credentials for NON-admin callers on the REST and SSE doors (MCP requires an authenticated admin, these don't) #1167
The opt-in reveal_secret_headers flag is ANDed with caller identity on the MCP door but checked alone on the REST and SSE doors. With the flag on, an agent token — or in the server edition any tenant who mints one — is handed raw upstream credentials on surfaces the MCP door would mask for the same caller.
CanRevealSecrets() (internal/auth/context.go:151) is IsAdmin() && !Anonymous — deliberately stricter than IsAdmin, and nil-safe so an absent context is unprivileged rather than admin-by-absence.
These sites check the flag only:
internal/httpapi/server.go:1619 — redactServerSecrets, backing GET /api/v1/servers
internal/httpapi/server.go:4247 — the doctor/diagnostics route
internal/runtime/event_bus.go:335 — the /events SSE servers.changed payload
internal/management/diagnostics.go:71
internal/upstream/manager.go:1705
Repro
With "reveal_secret_headers": true in config, present an agent token (mcp_agt_ prefix, no admin role) to GET /api/v1/servers. Every upstream's headers and env come back in the clear. The same token calling MCP upstream_servers list gets masked values.
Notes for whoever fixes it
The SSE case is genuinely different: event_bus.go builds one payload and broadcasts it, so there is no per-caller context to AND against. That door probably has to stay masked unconditionally, or gate what a subscription is allowed to receive — a raw broadcast cannot be correct for a mixed-privilege audience, which is the shape the server edition creates.
internal/upstream/manager.go:1705 is an internal/logging consumer; worth checking whether it is on a caller-facing path at all before changing it.
Severity
Off by default, so this is a hardening gap rather than a default-on leak — but the flag exists precisely so an operator can see their own credentials, and it currently reveals them to every caller instead. In the server edition that is a cross-tenant disclosure of admin credentials.
Found during the #1161 residual sweep (#1165); out of scope there because it spans six sites across three packages and needs a decision about SSE.
Activity
fix(security): close the remaining scoped-caller read doors (#1166 ro…
fix(security): withhold the activation block and gate the last two wr…
fix(security): gate the REST and SSE doors on caller identity and tok…
docs(security): add the release advisory for the credential-exposure …
Dumbris commentedon Sep 2, 2026
Fixed in #1182 (merged 2026-09-02). GitHub only auto-closed the first reference in that PR's "Closes" line, so closing manually.
test(scope): guard the /api/v1 GET surface against unscoped routes (#…