Skip to content

MCPSecBench: A systematic security benchmark and testbed for testing the Model Context ProtocolMCPSecBench: A Systematic Security Benchmark and Playground for Testing Model Context Protocols

arXiv· arXiv:2508.13220· Yixuan Yang, Cuifeng Gao, Daoyuan Wu, Yufan Chen, Yingjiu Li, Shuai WangEurecom; Lingnan University; University of Oregon; HKUSTIndexed by this site · 14 days ago· Originally publishedSelected EvaluationSelectedAttention41

Quick read

Evaluation and benchmarks

Based on the paper PDF (AI-generated); refer to the original

The authors propose the MCP security benchmark MCPSecBench, covering 4 attack surfaces and 17 attacks, evaluated on Claude Desktop, OpenAI, and Cursor; they state that every attack surface had successful attacks, and the average success rate of the two defenses is below 30%.

Questions
MCP lets LLM agents connect to external data and tools, expanding the attack surface; the authors state that existing MCP security research covers only isolated threats and lacks a holistic evaluation framework spanning the entire architecture.
Methods
The authors first formalize four sets of specifications for secure MCP (client, protocol, server, host), and on this basis divide 4 attack surfaces and 17 attacks, building the benchmark MCPSecBench that integrates a prompt dataset, malicious/vulnerable servers, attack scripts, a GUI testing tool, and defense mechanisms.
Experiments and results
Attacks were executed 15 times each on Claude Desktop, OpenAI, and Cursor: the authors state that all four attack surfaces had successful attacks, with protocol-side ASR 100% and ATT-3/5/6/14 at 100% across all platforms; the average mitigation success rates of MCIP and FAN were 17.9% and 28.9%, respectively.
Limitations and future work
The paper does not specifically discuss limitations. Experimental coverage: 3 MCP platforms, 17 attacks, 2 dynamic defenses (MCIP, FAN), each attack executed 15 times; defenses are evaluated on only 11 attacks; the paper does not report the model used for LLM judging or human agreement.
Experimental setupClaude Desktop (claude-opus-4.5)、OpenAI (GPT-4.1) et al. · MCPSecBench · ASR、RR
Threat model
The authors formalize secure MCP as four groups of specifications—client, protocol, server, host—where any deviation from the specifications constitutes a potential attack; the attack surfaces cover prompt injection, protocol-layer man-in-the-middle and DNS rebinding, malicious/vulnerable servers, and host implementation flaws and misconfigurations, with the victim systems being MCP hosts and the servers they connect to.
Evaluated models
Claude Desktop (claude-opus-4.5)OpenAI (GPT-4.1)Cursor (v2.3.29 auto)MCIP-Guardian (MCIP)Firewalled-Agentic-Networks (FAN)
Benchmarks
MCPSecBench
Metrics
ASRRR
AI summaryand selection rationaleResearchers from Lingnan University and other institutions propose MCPSecBench in an arXiv paper, a systematic security benchmark and testing platform for the Model Context Protocol (MCP), covering four attack surfaces—client, protocol, server, and host—with a total of 17 attack types. The paper provides a formal specification for secure MCP; the benchmark integrates prompt datasets, malicious and vulnerable MCP servers, a vulnerable client containing CVE-2025-6514, protocol-layer attack scripts, and a GUI testing tool, and has been open-sourced on GitHub. Evaluations on Claude Desktop (Claude Opus 4.5), OpenAI (GPT-4.1), and Cursor (v2.3.29) show that all four attack surfaces successfully breached at least one platform; protocol-side attacks such as MCP Rebinding and man-in-the-middle achieved a 100% attack success rate on all three platforms, and prompt injection achieved a 0% success rate on Claude Desktop and 100% on Cursor.

Researchers from Lingnan University and other institutions propose MCPSecBench in an arXiv paper, a systematic security benchmark and testing platform for the Model Context Protocol (MCP), covering four attack surfaces—client, protocol, server, and host—with a total of 17 attack types. The paper provides a formal specification for secure MCP; the benchmark integrates prompt datasets, malicious and vulnerable MCP servers, a vulnerable client containing CVE-2025-6514, protocol-layer attack scripts, and a GUI testing tool, and has been open-sourced on GitHub. Evaluations on Claude Desktop (Claude Opus 4.5), OpenAI (GPT-4.1), and Cursor (v2.3.29) show that all four attack surfaces successfully breached at least one platform; protocol-side attacks such as MCP Rebinding and man-in-the-middle achieved a 100% attack success rate on all three platforms, and prompt injection achieved a 0% success rate on Claude Desktop and 100% on Cursor.

Why it was selectedThis benchmark extends MCP security evaluation from scattered server-side threats to four layers: client, protocol, server, and host. Teams deploying MCP can use it to test their own components' exposure to protocol-layer attacks.

Related events and news

1 events · 1 news mentions

News that mentions this paper

研究提出分支引导攻击与 COBRA 防御架构

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors state that MCP expands the attack surface while existing research is fragmented, and propose a security benchmark covering four attack surfaces and 17 attacks.

    Core problem: the MCP ecosystem lacks a systematic security evaluation framework covering the entire architecture, so the authors propose formal specifications and the benchmark MCPSecBench.

    • Scenario and importance: MCP is a general open standard connecting AI agents with data sources and external tools; the authors state that while it enhances LLM agent capabilities, it introduces new security risks and expands the attack surface, and that MCP agents increasingly connect to sensitive enterprise systems and physical facilities.
    • Gaps in existing research: the authors state that existing MCP security research mainly focuses on isolated threats or specific attack scenarios and lacks a holistic framework for assessing risk across the entire architecture; related work mostly focuses on the server side and relies on proprietary MCP hosts, hindering reproducibility (§6).
    • Core observation: the authors give a formal definition of secure MCP and specifications, and consider any behavior deviating from these specifications to constitute a potential attack; on this basis they divide four attack surfaces: client, protocol, server, and host.
    • Paper outputs: a taxonomy of 17 attack types, and MCPSecBench—a benchmark and testbed integrating a prompt dataset, MCP servers, clients, attack scripts, a GUI testing tool, and defense mechanisms, supporting modular extension.
    • Threat model (per the specification formalization in §3 of the paper):
      • Attacker goals: cause the MCP workflow to violate one of the four groups of specifications, e.g., performing unauthorized operations, tampering with transmitted messages, or making tool outputs violate security constraints.
      • Attack surfaces: client (prompt injection, etc.), protocol layer (man-in-the-middle, DNS rebinding), server (malicious/vulnerable servers), host (implementation flaws and misconfigurations).
      • Victim systems: the three major MCP platforms Claude Desktop, OpenAI, and Cursor and the MCP servers they connect to.
      • Success determination: an attack succeeds if it causes a specification violation in MCP operations; it fails if the host or AI actively detects and refuses it; failures due to unrelated technical issues are recorded as execution errors (§4).
  2. What related research exists?

    Related work falls into two categories, MCP benchmarks and MCP security; the authors state that the former mostly cover a single attack surface and fewer than 3 vulnerability types.

    MCP benchmarks

    • MCPWorld (Yan et al., 2025): a functional benchmark for Computer Use Agents with GUI support, verifying task completion.
    • MCIP (Jing et al., 2025): models risks introduced by user interaction and maps them to specific attack surfaces; its defense component MCIP-Guardian is integrated in this paper as a defense under test.
    • SafeMCP (Fang et al., 2025): evaluates threats introduced by third-party services, focusing on how malicious service providers can exploit the ecosystem.

    MCP security (attacks and defenses)

    • MCP Safety Audit (Radosevich & Halloran, 2025) and Song et al. (2025): the former explores attacks such as command execution and credential theft, the latter identifies four categories of attacks.
    • MCP Guardian (Kumar et al., 2025) and the subsequent MCP-Guard (Xing et al., 2026a): add authentication, rate limiting, WAF, and runtime semantic checks, respectively.
    • ETDI (Bhatt et al., 2025): uses OAuth-enhanced tool definitions and policy-based access control to address tool squatting and rug pull; Li et al. (2025) performs static analysis of MCP server source code; industry scanners include mcp-scan and AI-Infra-Guard.

    Comparison and positioning (Table 3): the authors summarize that, apart from MCIP, which covers 10 vulnerability types, most studies cover fewer than 3 types and are limited to a single attack surface; defense evaluation is fragmented (self-evaluation or isolated safeguards); and all lack a systematic formal foundation. The authors accordingly position this paper as: formalization-based, covering 4 attack surfaces and 17 vulnerability types, and supporting evaluation of general defense mechanisms.

    Baselines and benchmarks: this is a benchmark paper with no methodological baseline; the defenses under test are MCIP and FAN (Abdelnabi et al., 2025, originally designed for LLM agents and applicable to MCP), evaluated on the authors' own MCPSecBench.

  3. How does the paper address this problem?

    First formalize four sets of specifications for secure MCP, then build 17 attacks and the modular benchmark MCPSecBench based on specification violations.

    Overall approach: abstract the MCP system as a five-tuple and give four sets of security specifications, any specification violation is an attack; on this basis, implement 17 attacks covering four attack surfaces, two dynamic defenses, and an automated evaluation pipeline, forming MCPSecBench.

    Formalization and specifications (§3)

    • System model: MCP is defined as a five-tuple M = ⟨C, P, S, D, F⟩, where C/P/S are client, protocol, and server, D is data objects (initialization, prompts, messages, responses), and F is the sequential execution flow; sent messages M and received messages M′ are distinguished to characterize network tampering.
    • Client specification: ∀ p ∈ P, Process(p) ⇒ (Secure(p) ∧ ValidTools(p)), i.e., processed prompts must be free of malicious injection and generated tool calls must match user intent.
    • Protocol specification: ∀ m ∈ M, Received(m) ⇒ Sent(m), i.e., received messages must come from an authenticated counterparty and must not be tampered with by a man-in-the-middle.
    • Server and host specifications: executed tools must be Verified and outputs must not violate security constraints (including LLM safety guardrails, permission policies, semantic consistency); the host side requires that operations with side effects are authorized and that the global configuration ValidConf holds.

    Attack components (§4, Appendix A)

    • 17 attacks: host side includes Configuration Drift, Schema Inconsistencies, Vulnerable Client (CVE-2025-6514); client side includes Prompt Injection, Tool/Service Misuse via "Confused AI"; protocol side includes Man-in-the-Middle and MCP Rebinding; server side is divided into vulnerable servers (command injection) and malicious servers (overriding five categories of features: metadata, prompts, tools, resources, configuration).
    • Formal correspondence: Appendix A writes each attack as a violation of some specification in §3 (e.g., Prompt Injection violates Secure(p), Rug Pull violates Verified(t)).

    Defense and evaluation components (§4, Appendix B)

    • Defenses: focus on dynamic defenses (effective during interaction), integrating MCIP-Guardian (designed specifically for MCP) and FAN (designed for LLM agents, usable for MCP).
    • Judgment criteria: an attack that causes a specification violation is a success; active detection and refusal by the host or AI is a failure; failure due to unrelated technical issues such as missing files is recorded as an execution error.
    • Implementation components: 5 reference MCP servers, a deliberately vulnerable MCP client (mcp-remote 0.0.15, CVE-2025-6514), hosts compatible with the three major providers, an adversarial prompt library, a GUI testing tool; the GUI tool integrates an LLM judge that determines whether an attack succeeded based on the degree of alignment between the adversarial goal defined in the specifications and the system response (Appendix B).
    • Metrics: ASR = Nsuccess/Ntotal, RR = Nrefusal/Ntotal (Equation 6).
  4. What experiments did the paper conduct?

    Each attack was run 15 times on each of the three platforms: protocol-side ASR is 100% throughout, and the two defenses have average mitigation rates of 17.9% and 28.9%.

    Experimental Setup

    • Platforms under test: three MCP hosts: Claude Desktop (claude-opus-4.5), OpenAI (GPT-4.1), and Cursor (v2.3.29 auto).
    • Attacks and defenses: all 17 attacks; the defense evaluation targets 11 attacks for which at least one method has detection capability, with the mechanisms being MCIP and FAN.
    • Number of repetitions: each attack was executed 15 times (§5.1; the authors state this is for statistical robustness, but no significance test is reported).
    • Metrics: ASR (attack success rate) and RR (refusal rate), computed per Equation 6.
    • Evaluation method: the GUI testing tool integrates an LLM judge to determine whether an attack succeeded (Appendix B); the paper does not state which model was used for judging.
    • Cost: Appendix E reports tokens and price for each attack (Table 4).

    Main Results

    According to Table 1 (N/D is the native setting without defenses; values are ASR; RR in parentheses):

    Swipe horizontally to read the table

    Attack surfaceClaude DesktopOpenAICursor
    Client-side Avg.33.3% (66.7%)66.7% (31.1%)80% (20%)
    Protocol-side Avg.100% (0%)100% (0%)100% (0%)
    Server-side Avg.78.1% (14.3%)75.2% (10.5%)75.2% (14.3%)
    Host-side Avg.58.3% (26.7%)75% (0%)81.7% (0%)
    • Authors' interpretation: client-side has the lowest ASR and highest RR; the authors suggest this may be because client-side attacks mainly rely on prompt injection and "Confused AI," and modern LLMs are being trained to better detect and refuse them; the 100% ASR on the protocol side reflects that the MCP specification itself lacks native security mechanisms.
    • Structural attacks: ATT-3 (Schema Inconsistencies), ATT-14 (Vulnerable Client), ATT-5 (MCP Rebinding), and ATT-6 (Man-in-the-Middle) achieve 100% ASR on all three platforms in the controlled environment, and the defenses under test cannot detect or mitigate them (§5.2).
    • Platform differences: based on Figure 3, the authors state that Cursor has the broadest set of vulnerable attack surfaces and the lowest native detection capability, while Claude Desktop has the highest overall resistance; ATT-4 (Slash Command Overlap) applies only to Cursor (ASR 100%).

    Defense Mechanism Evaluation

    • Coverage and success rate (Table 2): MCIP covers 11 attacks with an average mitigation success rate of 17.9%; FAN does not cover ATT-2 and ATT-12, and averages 28.9% on the attacks it covers. Individual items such as ATT-10: MCIP 55.6%, FAN 64.4%; ATT-17: MCIP 46.7%, FAN 51.1%.
    • Host dependence: the authors state that MCIP achieves RR of 100% for Data Exfiltration (ATT-8) on Claude Desktop, but has little effect on Cursor and OpenAI; FAN's mitigation profile is relatively consistent across platforms.
    • Mechanism explanation: the authors believe the defenses work by enhancing the LLM's autonomous threat detection, and that the rise in RR does not come only from external interception; they also state that current defenses succeed only in a few attack scenarios, with average success rates below 50% (the abstract states below 30%).

    Cost Analysis

    • MCIP cost increase (Figure 4): Claude Desktop rises from $0.41 to $0.76 per round, OpenAI from $0.11 to $0.18, and Cursor from $0.11 to $0.46; the authors state this is close to four times the baseline on Cursor.
    • FAN cost: roughly on par with the native environment on each platform (Figure 4); Appendix E states that FAN relies mainly on static rule settings, with token usage close to N/D, whereas MCIP has higher overhead because it generates tool-call metadata and invokes a second-review agent.

    Other Ablations and Analyses

    • ATT-1 prompt injection (Appendix D): Claude Desktop ASR 0%/RR 100%, OpenAI RR 73.3%, Cursor RR 0%.
    • ATT-7 Tool Shadowing: Cursor's ASR of 6.7% is the lowest; the authors' investigation found this is not due to better detection but to Cursor's architecture limiting repeated or sequential tool execution within a single round.
    • ATT-2 anomaly: the authors state that "Confused AI" depends on randomness, and in individual cases enabling MCIP instead increased ASR and decreased RR.
    • ATT-16/17: in Sandbox Escape, Claude Desktop ASR is 0%, while OpenAI and Cursor are both 100%; in Vulnerable Server, some failures stem from environment errors such as "File Not Found" rather than security filtering.
    • ATT-13 Rug Pull: ASR across the three platforms is 73.3%–93.3%; the authors state that hosts only perform initial validation and lack continuous runtime verification.
  5. What are some points that can be further explored?

    The paper does not specifically discuss limitations; the experiments cover 3 platforms, 17 attacks, and 2 dynamic defenses, each executed 15 times.

    Limitations and future directions noted by the authors

    • The paper does not specifically discuss limitations (there is no Limitations section; the Conclusion and Impact Statement do not list limitations or future work items).

    Scope of experimental coverage

    • Platforms tested: Claude Desktop (claude-opus-4.5), OpenAI (GPT-4.1), Cursor (v2.3.29 auto), 3 MCP hosts in total (§5.1).
    • Attack coverage: 17 attacks across 4 attack surfaces, each executed 15 times; ATT-4 applies only to Cursor (marked N/A in Table 1).
    • Defense evaluation: only 2 dynamic defense mechanisms, MCIP and FAN, and only evaluated on the 11 attacks for which at least one method has detection capability; static defenses (code-scanning type) are out of evaluation scope (§4, §5.1).
    • Review and consistency: attack success is judged by an LLM judge integrated into the GUI testing tool (Appendix B); the paper does not report the model used for judging, manual review, or agreement between the judge and humans.
    • Environment and cost: experiments were conducted in a controlled isolated environment on the researchers' own accounts (Impact Statement); cost is reported per round of testing in tokens and USD (Table 4); the paper does not report wall-clock time.
  6. Summarize the main content of the paper

    MCP security benchmark MCPSecBench: formalizes four groups of specifications and 17 attacks; evaluation on three platforms shows every attack surface was compromised.

    An MCP security evaluation/benchmark paper: the authors give a formal definition of secure MCP and four groups of specifications (client, protocol, server, host), argue that any specification violation is a potential attack, and on this basis build a benchmark and testbed covering 4 attack surfaces and 17 attacks, MCPSecBench, integrating a prompt dataset, malicious/vulnerable servers, a client with CVE-2025-6514, protocol attack scripts, a GUI testing tool, and two dynamic defenses.

    • Problem: the authors state that existing MCP security research is fragmented, mostly limited to a single attack surface, and relies on proprietary hosts, lacking a holistic evaluation framework.
    • Method highlights: MCP systems are modeled as a five-tuple; attack implementations cover prompt injection, man-in-the-middle, DNS rebinding, tool poisoning, rug pull, sandbox escape, etc.; ASR/RR are determined by an LLM judge based on specification violations.
    • Main results (Table 1, 15 runs per attack): protocol-side attacks have ASR of 100% on Claude Desktop, OpenAI, and Cursor; the four structural attacks ATT-3/5/6/14 are at 100% on all platforms and defenses are ineffective; client-side average ASR ranges from 33.3% (Claude) to 80% (Cursor).
    • Defenses and cost: the average mitigation success rates of MCIP and FAN are 17.9% and 28.9%, respectively (Table 2); MCIP raises Cursor's per-round cost from $0.11 to $0.46, while FAN's cost is on par with native (Figure 4).
    • Authors' conclusion: every component of the current MCP ecosystem can be exploited to steal data or compromise the host, and existing defenses are mostly insufficient; the authors hope MCPSecBench will become a foundational platform for MCP security research, and it has been open-sourced.

Related papers

Read originalarxiv.org