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 mutating server endpoints lack agent-token gating (enable/disable/restart/quarantine/…) #878
Found during the cross-model review of PR #876: agent tokens (mcp_agt_) authenticate on the REST API (apiKeyAuthMiddleware → handleAgentTokenAuth → AuthTypeAgent, internal/httpapi/server.go:~384), but most mutating per-server endpoints have no IsAdmin() gate — an agent token blocked from an operation on the MCP surface (the upstream_servers agent-token denylist, internal/server/mcp.go:~2833) can perform the same operation over HTTP.
PR #876 gated the two endpoints it introduced/escalated (POST /servers/{id}/refresh, POST /servers/{id}/discover-tools, both 403 for agents, matching handleSetToolEnabled's pattern). Still ungated (pre-existing): enable/disable/restart/quarantine and possibly other mutating routes.
Suggested fix: a consistency pass aligning REST agent-token authorization with the MCP operation denylist — ideally one shared policy table instead of per-handler checks.
Activity
fix(security): shared agent-token operation policy — REST server muta…