arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.17549cs.CRcs.AI
收藏

打破协议:模型上下文协议规范的安全分析及工具集成LLM代理中的提示注入漏洞

Breaking the Protocol: Security Analysis of the Model Context Protocol Specification and Prompt Injection Vulnerabilities in Tool-Integrated LLM Agents

Narek Maloyan, Dmitry Namiot

AI总结:

本文分析了模型上下文协议的安全漏洞,提出MCPSec协议扩展以提升安全性,减少攻击成功率。

摘要:

模型上下文协议(MCP)已成为将大型语言模型与外部工具集成的事实标准,但目前尚无对协议规范的正式安全分析。我们首次对MCP的架构设计进行了严格的安全分析,发现了三个基本的协议级漏洞:(1)缺乏能力认证,允许服务器声称任意权限;(2)双向采样无来源认证,导致服务器端提示注入;(3)多服务器配置中的隐含信任传播。我们实现了\textsc{MCPBench},一种新的框架,连接现有的代理安全基准到MCP兼容的基础设施,从而能够直接测量协议特定的攻击面。通过在五个MCP服务器实现上进行受控实验,我们证明MCP的架构选择使攻击成功率比等效的非MCP集成提高了23-41%。我们提出\textsc{MCPSec},一种向后兼容的协议扩展,增加能力认证和消息认证,将攻击成功率从52.8%降低到12.4%,平均延迟开销为每条消息8.3毫秒。我们的发现表明,MCP的安全弱点是架构而非实现特定的,需要协议层面的修复。

英文摘要:

The Model Context Protocol (MCP) has emerged as a de facto standard for integrating Large Language Models with external tools, yet no formal security analysis of the protocol specification exists. We present the first rigorous security analysis of MCP's architectural design, identifying three fundamental protocol-level vulnerabilities: (1) absence of capability attestation allowing servers to claim arbitrary permissions, (2) bidirectional sampling without origin authentication enabling server-side prompt injection, and (3) implicit trust propagation in multi-server configurations. We implement \textsc{MCPBench}, a novel framework bridging existing agent security benchmarks to MCP-compliant infrastructure, enabling direct measurement of protocol-specific attack surfaces. Through controlled experiments on 847 attack scenarios across five MCP server implementations, we demonstrate that MCP's architectural choices amplify attack success rates by 23--41\% compared to equivalent non-MCP integrations. We propose \textsc{MCPSec}, a backward-compatible protocol extension adding capability attestation and message authentication, reducing attack success rates from 52.8\% to 12.4\% with median latency overhead of 8.3ms per message. Our findings establish that MCP's security weaknesses are architectural rather than implementation-specific, requiring protocol-level remediation.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑