Claude blocks' MCP tokens are on claude's command line (readable through /proc) #128
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found in the M44 review (2026-10-03). claude-agent-sdk (under claude-agent-acp) starts
claudewith--mcp-config <JSON>built from session/new'smcpServers. illogical's own server entry (agent/mod.rsInner::servers()) carries the block's MCP token, as anAuthorization: Bearerheader or asILLOGICAL_MCP_TOKENin env. So any local user can read every running Claude block's token from/proc/<pid>/cmdline. Mounting /proc with hidepid would stop it, but Ubuntu doesn't by default.That mattered little on a single-user machine. Since M45 it does: geek runs Fountain sandboxes as the
fountainuser, and a sandbox agent can read any block token and drive that block's tab through the daemon. (Checked:sudo -u fountainreads jake's processes' cmdlines.)Fixes:
ProtectProc=invisibleandProcSubset=pidto the runner's unit; Jake re-runs the setup script.${VAR}references in mcpServers, which Claude Code expands. M44's builder is checking that expansion works for--mcp-config.Interim mitigation on geek, 2026-10-03: a drop-in gives
fountain-runnerProtectProc=invisible; Jake ran it with sudo. Checked from inside a runner sandbox (a hud-playground conversation):ls /procshows 9 PIDs, all the sandbox's own, andpsusers are fountain only./home/jake,~/.ssh,/run/user/1000and illogical's state dir aren't listable. Asudo -u fountainshell outside the unit still sees everything, as expected. M45b makes the setting part of the unit. The real fix (no tokens in argv) is in M44's fixes.Fixed in M44's merge (
5110bb6). For every local Claude block, illogical's MCP entry isBearer ${ILLOGICAL_MCP_BLOCK_TOKEN}, and worn servers' values are${ILLOGICAL_FTN_…}. The values sit in the adapter's environment, and Claude Code expands them; the builder checked this against a real claude for headers, URLs and stdio env. Stdio args with variables, and values containing${, are left out rather than put on a command line. A sampledpsduring a worn pr-reviewer session showed no token. Adapters started by an older daemon are restarted on takeover. Codex and other ACP agents still get literal values (codex-acp passes config in-process). The runner unit's ProtectProc=invisible stays as defence in depth.