arXiv:2606.04769cs.CRcs.AI2026-06被引 2

发现大模型工具描述与代码不符,可能引发安全漏洞。

Description-Code Inconsistency in Real-world MCP Servers: Measurement, Detection, and Security Implications

论文配图:Description-Code Inconsistency in Real-world MCP Servers: Measurement, Detection, and Security Implications
图 1 · 摘自论文原文
  • 构建自动检测框架,比对工具描述与代码实现。
  • 在2214个真实服务器中发现9.93%存在描述不一致。
  • 适合关注AI安全、工具链可信性的研究人员。

模型上下文协议(MCP)已成为大型语言模型调用外部工具的关键标准。在此生态中,LLM依赖MCP服务器提供的自然语言描述来选择和执行功能,隐含假设是描述与实际代码一致,但实践中该假设未被强制验证。由此导致描述-代码不一致(DCI)问题:工具描述的能力与安全边界与其实际行为不符。本文对真实MCP服务器中的DCI展开全面研究,首次形式化定义该问题,并提出涵盖功能不一致与未声明副作用的分类体系。基于此,我们开发了DCIChecker,结合结构感知静态分析与直接-反向-仲裁提示法,实现描述与代码的交叉验证。在包含19,200对描述-代码的大型数据集上应用该框架,测量结果显示9.93%的配对存在不一致。进一步表明,DCI会形成关键防御盲区,诱发从运行失败到隐蔽恶意行为等多重风险。最后,我们提出增强语义一致性的缓解策略,以提升新兴智能体生态的可靠性。

原文摘要 · Abstract (English)

The Model Context Protocol (MCP) has emerged as a critical standard empowering Large Language Models (LLMs) to utilize external tools. In this ecosystem, LLMs rely on natural language descriptions provided by MCP servers to select and execute functions. This interaction implicitly assumes that tool descriptions faithfully reflect their underlying implementations, while this assumption is not mandatorily verified in practice. As a result, MCP deployments may suffer from a problem named Description-Code Inconsistency (DCI), where a tool's description of its capabilities and security boundaries is not consistent with what the code actually does. In this paper, we present a comprehensive study of DCI in real-world MCP servers. We formally define the problem and propose a comprehensive taxonomy spanning functionality inconsistencies and undeclared side effects. Guided by this taxonomy, we develop DCIChecker, an automated framework that combines structure-aware static analysis with the Direct-Reverse-Arbitration prompting method to cross-validate tool descriptions against actual code implementations. We apply this framework to a large-scale dataset comprising 19,200 description-code pairs extracted from 2,214 real-world MCP servers. Our measurement reveals that DCI is widespread, with 9.93% of these pairs exhibiting inconsistencies. We further demonstrate that DCI creates a critical defense blind spot, facilitating varied risks from operational failures to stealthy malicious behaviors. Finally, we propose mitigation strategies to enforce semantic consistency and enhance the reliability of the emerging agentic ecosystem.

AI安全模型一致性工具链

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。