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
REST server enumeration ignores agent-token scope: /api/v1/servers and /api/v1/config list every server regardless of allowed_servers #1166
GET /api/v1/servers and GET /api/v1/config enumerate every configured upstream to any caller holding an agent token, with no filtering by that token's allowed_servers scope. The MCP surface does filter — internal/server/mcp.go:3733 gates each entry on authCtx.CanAccessServer(s.Name) — so the REST doors are a scope bypass for enumeration.
Credentials are masked on both routes (/servers via redactServerSecrets, /config since #1165), so this is a metadata disclosure: names, protocols, commands, URLs, enablement, topology.
Sites
internal/httpapi/server.go:1504 — handleGetServers: no CanAccessServer filter on either the management-service path or the legacy fallback.
internal/httpapi/server.go — handleGetConfig: serves the whole mcpServers array (masked) to a non-admin.
Why it matters
In the server edition this crosses a tenant boundary. A regular user mints an agent token for themselves at POST /api/v1/user/tokens (internal/serveredition/api/user_handlers.go:707), then reads the admin's entire upstream inventory — including servers with shared: false that the per-user door (/api/v1/user/servers) correctly hides. The per-user door was the subject of #1161; these two routes reach the same data on the same mux, past a different gate.
In the personal edition the impact is smaller (the token's owner configured the servers), but allowed_servers is documented as a scope and it does not hold here.
Found during
The #1161 residual sweep (#1165). Deliberately not folded into that PR: scope-filtering REST enumeration is a behaviour change affecting both editions and the Web UI, and wants its own decision about what a scoped token should see — an empty list, its allowed subset, or names-only.
Suggested direction
Filter both handlers through the same CanAccessServer predicate the MCP door uses, so a scoped token sees exactly its allowed subset. Admin contexts (API key, tray socket, OAuth admin) are unaffected. Consider whether /config should omit mcpServers entirely for a non-admin rather than render a filtered array.
Activity
fix(security): scope the whole /events class, not just servers.changed (
fix(security): close the remaining scoped-caller read doors (#1166 ro…
fix(security): stop /info handing the admin API key to a scoped token (…
fix(security): withhold the activation block and gate the last two wr…
test(security): follow the upstream_stats producer rename in the door…
fix(security): gate the REST and SSE doors on caller identity and tok…
docs(security): add the release advisory for the credential-exposure …
fix(scope): LanguageMismatchError was the one refusal that ignored di…
fix(scope): stored-script enumeration is administrator-only (Spec 105…
test(scope): guard the /api/v1 GET surface against unscoped routes (#…
fix(httpapi): hold profile-pinned agent tokens to their pin on GET /a…