mcp: a caller cannot detect that a provider's tool definitions changed

未关闭
#561 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
go

调研方向

Start by reading verifyGossipToolRows and verifyGossipToolRowsWithFetcher in internal/node/mcp_handlers.go, then inspect NodeCatalogReport in api/sam.proto and the required_labels flow. Use the open questions to settle the digest, session, and configuration design before changing the three implementations; done means the chosen continuity behavior is specified and the SDK parity matrix remains accurate.

由索引模型根据 Issue 内容生成。

描述

The gap

A caller that reaches a provider over /sam/mcp/1.0.0 verifies who the provider is — the Biscuit is signed by a trusted control-plane key, bound to the peer, unexpired, carrying sam:role:node. Nothing verifies that the tool it is about to call is the same tool it saw last time.

The mesh deliberately takes the live value as authoritative. verifyGossipToolRows (internal/node/mcp_handlers.go:344):

treats unsolicited announcements as routing hints, not authorization evidence. Each candidate is confirmed through the existing authenticated MCP session and exact tools/list response before it is exposed.

and verifyGossipToolRowsWithFetcher keeps the fetched description, discarding what was announced. That is correct for an announcement, and it also means nothing in the mesh remembers what a tool looked like before.

The control plane does not fill that role: NodeCatalogReport (api/sam.proto:367) is "Display-only; carries no authorization weight."

An enrolled node can therefore change a tool's description or its input schema at any time, and every caller keeps treating it as the tool it originally reviewed.

Why it matters

This is a named class — "MCP rug pull". The Cloud Security Alliance describes it as "tool definitions changed server-side after security review and user approval", with the impact "persistent covert access after trust has been established; compliance audit failure". Invariant Labs published it as a security notification.

The MCP specification's security best practices (2026-07-28) names nine threats; this is not among them. A mesh that wants to address it is on its own.

Enrolled providers

SAM providers hold a control-plane credential rather than being arbitrary servers someone installed, which narrows the threat but does not remove it. Enrollment proves identity, not intent, and a compromised but still-enrolled node is the case AGENTS.md names:

Zero Trust: Assume no implicit trust between nodes, control planes, routers, or external actors.

The trust a caller places in a tool definition is currently implicit, and it is the one input to the agent's decision that nothing in the mesh attests.

Sketch

Modelled on required_labels, so it lands where callers already look:

  1. A canonical digest over the tools/list response — tool names, descriptions, input and output schemas, deterministically ordered and serialised.
  2. An optional expected_tools_digest on the session, alongside required_labels.
  3. A mismatch refuses the session with a typed error, as LabelsNotSatisfiedError does.
  4. All three implementations, to keep the SDK parity matrix accurate.

Open questions

  • Opt-in or default? Tools legitimately change, and MCP has tools/list_changed. A caller-supplied pin seems right; a mesh-wide default does not.
  • Where does the first digest come from? Trust on first use, or operator configuration. The second is stronger and needs a configuration path.
  • Canonicalisation. JSON Schema has map ordering and number formatting; a digest that is not byte-stable produces false alarms. Getting this wrong is worse than not having it.

Limits

This detects change, not malice. A provider hostile from the first call is unaffected — it is a continuity control, not a trust decision.

Happy to implement whichever shape you settle on, or to drop it if continuity belongs elsewhere in the design.

主要语言
Go
星标
1.2k
派生
207
平均合并
1 天 10 小时
30 天内合并 PR
85

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

google/agentmesh 的其他 Issue

查看 google/agentmesh 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。