"MCP Does Not Stand for Misuse Cryptography Protocol": Uncovering Cryptographic Misuse in Model Context Protocol at Scale

Biwei Yan, Yue Zhang, Minghui Xu, Hao Wu, Yechao Zhang, Kun Li, Guoming Zhang, Xiuzhen ChengarXiv 2025 · DOI · arXiv

Abstract

The Model Context Protocol (MCP) is rapidly becoming the "USB-C for AI applications," providing a standardized interface for Large Language Models (LLMs) to interact with external tools and data. However, MCP lacks native encryption or authentication mechanisms, forcing developers to implement ad hoc cryptographic solutions. This paper presents MICRYSCOPE, a specialized framework for detecting cryptographic misuse in the MCP ecosystem. Through a large-scale analysis of 9,403 MCP servers, the study reveals that 19.7% of crypto-enabled servers contain critical vulnerabilities, including leaked API keys and broken authentication. The findings highlight a unique "LLM-in-the-Middle" risk, where secure functions can be composed into insecure workflows by the LLM at runtime.

The Security Gap in MCP

While MCP effectively handles data schemas, it provides zero built-in guarantees for confidentiality or authenticity. This creates a significant security gap as developers are left to implement their own security measures. The authors identify three unique challenges in auditing this ecosystem:

  1. Multi-Language Heterogeneity: MCP servers are implemented across diverse languages (Python, JavaScript, Go, C++), each with varying cryptographic libraries and default behaviors.
  2. Weakly Coupled Functions: Unlike traditional software with explicit call graphs, MCP tools are often collections of independent functions. An LLM might chain these functions at runtime, creating insecure workflows that do not exist in the static source code.
  3. Contextual Semantics: Existing tools struggle to distinguish between safe uses of weak primitives (e.g., MD5 for file checksums) and dangerous ones (e.g., MD5 for password storage).

MICRYSCOPE: A Domain-Specific Framework

To address these challenges, the authors developed MICRYSCOPE, which utilizes a three-stage pipeline:

  • Unified Intermediate Representation (IR): Normalizes source code from various languages into a language-agnostic, JSON-based IR.
  • Hybrid Dependency Analysis: This novel contribution combines standard "Must" analysis (explicit data flows) with "May" analysis. The latter models potential runtime compositions by the LLM, assuming that functions sharing resources (like filenames or variable names) might be chained together.
  • Taint-Based Misuse Detector: Tracks data from sources to sinks, checking against eight specific security rules, such as the use of hard-coded keys or insecure block modes.
Figure 2: MICRYSCOPE's hybrid dependency analysis, modeling both explicit 'Must' edges and potential runtime 'May' edges created by LLM orchestration.

Large-Scale Empirical Analysis

The authors conducted an "at scale" study by crawling 9,403 MCP servers from seven major registries, including Mcpmarket, Smithery Registry, and Pulse MCP. From this corpus, 720 servers were identified as implementing cryptographic logic for deeper analysis.

Key Insights: The "LLM-in-the-Middle" Risk

A striking insight from the study is that an MCP tool can be secure in isolation but become insecure when an LLM orchestrates its functions. If a developer provides both a secure and a weak key derivation function, the LLM's choice at runtime determines the final security posture.

Figure 1: The LLM-in-the-Middle risk, where an LLM may choose an insecure execution path (Path 1) over a secure one (Path 2) when orchestrating weakly coupled functions.

Furthermore, the study found significant disparities in security quality across registries. The Smithery Registry exhibited a 42% misuse rate among its crypto-enabled servers. Python, while dominant in the AI space, also showed the highest misuse rate (34%), likely due to the uneven quality of its library ecosystem and prevalent implicit defaults.

Results and Real-World Impact

Out of the 720 crypto-enabled servers analyzed, 19.7% (142 instances) contained at least one cryptographic misuse. The most common vulnerability was Missing Integrity Protection (Rule R7), where developers used encryption (like AES-CBC) without an accompanying MAC or authenticated mode like GCM.

Real-world case studies revealed:

  • Leaked Keys: Plaintext Gemini and OpenAI API keys were found hard-coded in server configurations.
  • Broken Authentication: The "1Panel" MCP server utilized trivial-to-brute-force MD5-based tokens.
  • Legacy Crypto: Some tools exposed DES in ECB mode, propagating insecure primitives to any downstream application.

Conclusion and Future Work

While MICRYSCOPE provides a powerful tool for identifying vulnerabilities, it is primarily a static analysis tool and may miss dynamic runtime issues. Future work will focus on expanding rule coverage and developing automated remediation techniques to provide developers and LLMs with corrected, secure code patterns. As MCP continues to grow, addressing these fundamental security gaps is critical for the safe deployment of AI-integrated tools.

Summary updated

Abstract

The Model Context Protocol (MCP) is rapidly emerging as the middleware for LLM-based applications, offering a standardized interface for tool integration. However, its built-in security mechanisms are minimal: while schemas and declarations prevent malformed requests, MCP provides no guarantees of authenticity or confidentiality, forcing developers to implement cryptography themselves. Such ad hoc practices are historically prone to misuse, and within MCP they threaten sensitive data and services. We present MICRYSCOPE, the first domain-specific framework for detecting cryptographic misuses in MCP implementations. MICRYSCOPE combines three key innovations: a cross-language intermediate representation that normalizes cryptographic APIs across diverse ecosystems, a hybrid dependency analysis that uncovers explicit and implicit function relationships (including insecure runtime compositions orchestrated by LLMs) and a taint-based misuse detector that tracks sensitive data flows and flags violations of established cryptographic rules. Applying MICRYSCOPE to 9,403 MCP servers, we identified 720 with cryptographic logic, of which 19.7% exhibited misuses. These flaws are concentrated in certain markets (e.g., Smithery Registry with 42% insecure servers), languages (Python at 34% misuse rate), and categories (Developer Tools and Data Science & ML accounting for over 50% of all misuses). Case studies reveal real-world consequences, including leaked API keys, insecure DES/ECB tools, and MD5-based authentication bypasses. Our study establishes the first ecosystem-wide view of cryptographic misuse in MCP and provides both tools and insights to strengthen the security foundations of this rapidly growing protocol.
BibTeX
@misc{yan2025mcp,
  author = {Biwei Yan and Yue Zhang and Minghui Xu and Hao Wu and Yechao Zhang and Kun Li and Guoming Zhang and Xiuzhen Cheng},
  title = {{"MCP Does Not Stand for Misuse Cryptography Protocol": Uncovering Cryptographic Misuse in Model Context Protocol at Scale}},
  year = {2025},
  eprint = {2512.03775},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.03775},
}
Figure