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
security: server removal leaves prompt approvals, OAuth state and approval writers behind; same-name re-add inherits them #1562
Server removal does not purge all security state keyed by server name, so a same-name re-add inherits it:
REST removal (internal/server/server.go:2153-2240) deletes tool approvals and OAuth state but not prompt approvals (DeleteServerPromptApprovals exists, internal/storage/bbolt.go:758, but removal never calls it) or per-server call history.
Config-driven removal (lifecycle.go:1613-1640) deletes only the upstream row, history/index entries; tool approvals are left to the orphan prune, which is skipped when the configured set is empty (lifecycle.go:1455-1461) or when a save-resurrection keeps the name in the live config; OAuth state is not cleared.
Removal is not exclusive with approval writers: ApproveTools (internal/runtime/tool_quarantine.go:2019) reads a record and later upserts it with no commit lock or server-generation check, so a removal finishing in between lets the approval restore the deleted baseline. Scanner ApproveServer (internal/security/scanner/service.go:1697) can pause before UnquarantineServer, cross a remove/re-add, and unquarantine the replacement with the old server's approval.
Failure scenario
Remove server A (approved tool hashes, approved prompt hashes, OAuth tokens), re-add a different A under manual trust: matching tool/prompt hashes take the approved path (tool_quarantine.go hash match, internal/server/prompt_quarantine.go) without fresh review, and old OAuth credentials are reused.
Suggested direction
One shared "purge server security state" helper (tool approvals, prompt approvals, OAuth state, history, index, baseline markers) called by REST/MCP/config-driven removal; bind approval commits to a server generation and serialize them with removal.
Found by OpenCode Sol 6.1 cross-model review of the (now split) oversized PRs #1553 (UX-01) and #1555 (UX-02); verified still present on origin/main (704795c) by reading the cited sites. Pre-existing, deliberately out of scope of the minimal core PRs. Review transcripts: docs/qa/0.70.0-ux-2026-10-10/remediation/reviews/.
Activity
docs(specs): Spec 116: config commit consistency, atomic removal and …
fix: Spec 116 PR2 review round 1 — one-snapshot server views, bound t…
fix: atomic server removal with full purge and per-server incarnation…