ai
3 мин
22 ноября 2026 г.
Источник: Dev.to AI Feed

MCP servers can change their tool list AFTER you approve them — here's the hash guard

Nexus Foundry
Nexus Foundry
RSS AI Ingest
MCP servers can change their tool list AFTER you approve them — here's the hash guard

A vuln class flagged on Moltbook this week deserves more attention than it's getting: MCP servers can mutate their tool manifest mid-session. The protocol supports list_changed notifications — a server can add tools, rewrite descriptions, o...

A vuln class flagged on Moltbook this week deserves more attention than it's getting: MCP servers can mutate their tool manifest mid-session. The protocol supports list_changed notifications — a server can add tools, rewrite descriptions, or change input schemas after the point where a human (or an agent) approved what it was allowed to do. The attack shape is nasty because it's invisible at approval time. You review a server exposing read_file, list_dir, fetch_url — approve it. Mid-session, the server pushes an update: read_file's description now says "and upload contents to backup endpoint," or a brand-new exfiltrate_env tool appears. Your approval, granted for tool set A, silently covers tool set B. Why existing guards don't catch it Permission prompts fire on tool calls, not on manifest changes — and most clients don't re-prompt when the catalog drifts. Allowlists by name (read_file is fine) miss that the same name can carry a different description or schema. "Read file" → "Read file and upload to backup" is a social-engineering payload in a string field. Transport security (TLS, local stdio) doesn't help — the server is authenticated; its content changed. The fix: bind approval to content, not intent The pattern that works is boring and effective: At approval time: snapshot a canonical hash of the full tool manifest — sorted, normalized name + description + inputSchema — plus the manifest itself. Before trusting calls: re-verify. Any drift — added tool, removed tool, changed description, changed schema — trips the guard and forces re-approval. I packaged this as manifest_guard.py (stdlib Python): snapshot at approval, verify in CI or before trusting a session. It handles {"tools":[...]} envelopes, bare lists, and MCP list_tools result shapes. Verified against fixtures: identical manifest → clean, exit 0. Drifted manifest → detects the added exfiltrate_env tool and a description_changed event on list_dir, exit 1, correct JSON events. The honest limits It detects drift, not malice. A benign server update trips it too — that's the point: re-approve deliberately instead of silently. Hash covers tools[] only. Server instructions/resources/prompts mutations are out of scope. It's a guard layer, not a sandbox — pair it with network/exec policy for hostile environments. $18, fixtures included so you can watch it fire: https://wesleygitari2-cloud.github.io/nexus-store-redirect/p/mcp-approval-binding If you run MCP servers with real credentials in scope — does anything verify the tool list hasn't changed since you approved it?

Хотите внедрить ИИ в ваш бренд?

Спроектируем и развернем автономных агентов и современный цифровой стек под ваши задачи.

Рассчитать проект