高级检索

    针对大语言模型MCP服务器中权限使用的实证研究

    An Empirical Study of Privilege Usage in Large Language Model MCP Servers

    • 摘要: 当前大语言模型(LLM)允许用户通过模型上下文协议(Model Context Protocol,MCP)调用MCP服务器中的多种工具,进而与外部世界进行交互。然而,这些MCP服务器带来了新的安全隐患。具体而言,为了自动化完成诸如数据库查询和云服务设施管理等任务,这些工具被赋予了特定的权限。由于LLM安全性不足,攻击者可以利用LLM非法调用这些服务器所暴露的工具,对用户资产造成损害。因此,对MCP服务器和工具进行权限分析和控制至关重要。本研究设计了一个自动化分析框架,旨在对 MCP 服务器及工具进行深入分析。该框架通过静态分析,可以确定工具调用的权限接口及其调用方法,并根据权限的敏感程度和行为进行分类,从而探究当前工具的权限使用现状。本研究收集了1609个MCP服务器,并对200个 MCP 服务器进行了细致分析,发现平均每个MCP服务器调用40.47个权限接口。此外,高达52%的权限验证依赖于API token和账号密码,未能遵循最小权限原则。本研究旨在呼吁开发者严格控制 MCP 服务器的权限,并积极探索更加安全的权限控制机制。

       

      Abstract:
      The evolution of Large Language Model (LLM) and Model Context Protocol (MCP) have facilitated the development of various MCP servers and tools that extend LLM capabilities, allowing LLMs to interact with external services and content. However, these servers also introduce new security threats. Specifically, they are granted privileges to automate tasks such as email processing and cloud infrastructure management. Due to the inherent instability of LLM outputs and their susceptibility to manipulation, attackers can exploit LLMs to illicitly invoke these tools, causing severe damage. Therefore, the analysis and control of privileges for LLM servers are of paramount importance.
      This research designs an automated analysis framework to analyze MCP servers and their associated tools. Through static analysis, the framework identifies the privileged APIs called by these tools and their invocation methods. It then categorizes these privileges based on their sensitivity and corresponding behaviors to investigate the current state of privilege usage. We collected 1609 MCP servers and conducted a detailed analysis of 200, revealing that each server requests an average of 40.47s. Furthermore, a significant 52% of these privilege validations rely on API tokens and passwords, which fails to adhere to the principle of least privilege. This study calls for developers to implement stricter privilege controls for MCP servers and actively explore more secure authorization mechanisms.

       

    /

    返回文章
    返回