Skip to content

Security: user-registered MCP servers get blanket tool auto-approval in headless claude runs #126

Closed

Description

@currentbits

Problem

getClaudeMcpArgs (electron/memory-sup.js:216-232) builds --allowedTools=mcp__<name>__* for all activeServers(). That set includes user-added servers from settings, merged by syncUserMcpServers (memory-sup.js:156-190) into extraServers and written into the claude MCP config (writeMcpConfig, memory-sup.js:655-678). The comment at line 227 ("Scope is exactly our own servers' tools") is stale.

In headless -p runs there is no permission prompt, so every tool a user-added (possibly remote) MCP server exposes runs unapproved in every claude turn. The wildcard even pre-approves tools added server-side after registration, since it covers the whole namespace. A compromised or malicious MCP endpoint gets a silent, permanent code-execution channel.

Fix direction

Only first-party servers (coder-memory, coder-threads) should appear in the --allowedTools allow rule. User-registered servers can stay in the MCP config but should not be blanket-approved; if headless approval is desired for them, make it an explicit per-server opt-in in settings.

Activity

  1. added
    bug
    plan:todo
    plan:doing
    and removed
    plan:todo
    on Aug 16, 2026
  2. added
    plan:done
    and removed
    plan:doing
    on Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugplan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions