This article defines the MCP (Model Context Protocol) attack surface as every point where untrusted content, code, or credentials cross between the host application, client, servers, and backend systems. It maps three trust boundaries where attacks occur, identifies real CVEs affecting MCP implementations, and provides practical controls to reduce exposure. The article matters because the MCP specification explicitly cannot enforce its own security principles at the protocol level, leaving organizations responsible for consent, authorization, and access controlβmaking understanding this attack surface essential before deploying any MCP server.
- Three Trust Boundaries Structure RiskThe article identifies three distinct trust boundaries: between model and client (where tool descriptions enter as context), between client and servers (transport, sessions, consent), and between servers and backend systems they call (APIs, databases, files). Trust decreases moving downward; the host ranks highest and backend APIs are treated as untrusted from the protocol's perspective. This boundary mapping is critical because knowing which boundary an attack crosses tells you where the control belongs.
- Specification Admits Security Cannot EnforceThe MCP specification explicitly states it cannot enforce security principles at the protocol level. Consent flows, authorization, and access controls are delegated entirely to whoever builds the host, client, or server. This means being 'MCP compliant' tells you nothing about whether a server is safeβcompliance and safety are separate questions. The burden of implementing locks falls entirely on implementors, not the protocol.
- Local Servers Inherit User PrivilegesA stdio (standard input/output) MCP server is a process launched on the user's machine that runs with full user privileges, so a malicious startup command or payload gains access to files, SSH keys, and environment variables. HTTP localhost servers face a second vulnerability through DNS rebinding, where a hostile domain is repointed at 127.0.0.1, allowing browser pages to reach the local service. The article recommends showing exact commands, requiring approval, and sandboxing servers as defenses.
- Token Passthrough Creates Confused DeputyMCP authorization uses OAuth 2.1 with PKCE, and servers must accept only tokens issued for their own resources using audience binding through RFC 8707. Token passthroughβaccepting a token issued to someone else and forwarding it downstreamβis forbidden because the downstream API may trust it as if the server had validated it. This creates a confused deputy vulnerability where the downstream service incorrectly trusts an unvalidated credential.
- Real CVEs Show Protocol VulnerabilitiesThe article cites four specific security flaws: CVE-2025-6514 (CVSS 9.6 command injection in mcp-remote via malicious authorization-endpoint URL, fixed in 0.1.16), CVE-2025-49596 (CVSS 9.4 RCE in MCP Inspector via DNS rebinding, patched in 0.14.1), and the mcp-server-git chain (CVE-2025-68143, CVE-2025-68144, CVE-2025-68145) combining path bypass, unrestricted git_init, and argument injection for RCE. Additionally, TypeScript SDK before 1.24.0 and Python SDK before 1.23.0 lacked DNS rebinding protection for localhost services.
- Tool Descriptions Are Untrusted ContextThe model reads tool names, descriptions, and schemas as trusted context, often before any tool is actually called. Tool poisoning hides malicious instructions within descriptionsβtext addressed to the model rather than the user, using phrases like 'always' or 'do not tell the user'βwhich can steer model behavior. Resources (read-only data) carry the same risk because the model still reads them, making both untrusted input despite their intended purpose.
- Rug Pulls Change Definitions After ApprovalA rug pull differs from initial tool poisoning by deploying the attack after approval: a server passes review with clean definitions, then later changes them. The article recommends hashing or diffing tool definitions as JSON and comparing on every update. A changed description after approval is the signature of a rug pull; without version pinning and regular diffs, an organization cannot detect this post-approval tampering.
- Four Detection Habits Close Visibility GapsThe article recommends: (1) inventorying every server in host configs, including unapproved 'shadow' servers; (2) diffing tool definitions over time by hashing them and comparing JSON output; (3) logging tool calls with arguments and consent decisions for incident reconstruction; and (4) running tools like MCP Auditor on inventories to confirm hand-review findings. OWASP lists shadow servers and lack of audit and telemetry as top risks.
Bottom line: Before connecting any MCP server, read its tool descriptions, schemas, and startup commands as untrusted input, requiring explicit review and approval; then pin versions and diff tool definitions on every update to catch rug pulls where definitions change after deployment. No single security control eliminates MCP risk because the protocol itself delegates consent, authorization, and access control to implementorsβorganizations must treat each server as its own untrusted security domain and enfo
β±οΈ 45 min Β· Intermediate Β· 2 hands-on labs
Picture this: a colleague sends you a link to a handy new MCP server and says, just add it to your config. It takes thirty seconds. But before you do, you want to know what you are actually letting into your machine, and which parts of that setup an attacker could touch. That map is the mcp attack surface, and by the end of this Tutorial you will be able to draw it from memory.
I will walk you through the parts first: hosts, clients, servers, tools and resources. Then we draw the three trust boundaries, and I will show you where attacks such as tool poisoning, rug pulls, token passthrough and local server compromise land on that map. Knowing the boundary tells you where the control belongs.
After that we get practical. You will review the tools of a deliberately rogue MCP server in a local test setup, looking for hostile descriptions before anything connects. Everything runs on your own machine or the SecurityElites practice lab. We finish with the controls that actually shrink the surface.
π― What You Will Be Able to Do
β Before You Start
- Basic understanding of how LLM agents call tools
- Familiarity with APIs and OAuth concepts
- A browser to reach the SecurityElites labs
π In This Tutorial
- Direct answer: what the MCP attack surface is
- The building blocks: hosts, clients, servers, tools, resources
- Three trust boundaries, with an attack-surface diagram
- Threat model: mapping attack classes to each boundary of the mcp attack surface
- Local servers, tokens and real CVEs in the MCP attack surface
- Demo: reviewing a rogue MCP server for your mcp attack surface
- Detection: spotting exposure and abuse
- Reducing the mcp attack surface: defensive controls
- Your checklist
- What I want you to remember
- Questions people ask
Direct answer: what the MCP attack surface is
I want to give you the short answer first, then spend the rest of this page earning it. The mcp attack surface is every place where untrusted content, code or credentials cross between the host application, the client, the MCP servers and the systems behind those servers. If data or authority moves across one of those lines and nobody checks it, that is a point of attack.
MCP stands for Model Context Protocol. It is the standard way an AI application connects to tools and data. This page is part of a wider series, and the MCP security Day 2 map of the attack surface goes deeper if you want a second walk-through. For the bigger picture of agents and their risks, see the Agentic AI security guide.
One thing surprises people. The specification itself says it cannot enforce its security principles at the protocol level. Consent flows, authorisation and access controls are left to whoever builds the host, client or server. In plain terms: the protocol hands you the pipes, and you own the locks.
π§ Quick check
The building blocks: hosts, clients, servers, tools, resources
Before we map attacks, you need the vocabulary. I will keep each definition short, because you will see these words in every section that follows.
π Words I just used
The difference between tools and resources matters for defence. A tool does something, so the risk is action. A resource is only data, but the model still reads it, so a resource can carry hidden instructions. Both are untrusted input to the model.
Transports are how the client talks to the server. With stdio, the client launches the server as a local process on your machine, and it runs with your privileges. With HTTP, the server is reachable over a network address, so authentication and origin checks become your problem. Different transport, different exposure.
Three trust boundaries, with an attack-surface diagram
Now we draw the map. Security people think in trust boundaries, which are lines where data passes from a more trusted place to a less trusted one. MCP has three that matter: between the model and the client, between the client and its servers, and between the servers and the systems behind them.
- Model (reads context as instructions)
- Boundary 1: model and client
- Client / host (consent, policy)
- Boundary 2: client and MCP servers
- MCP server (tools, resources, sampling)
- Boundary 3: servers and backend systems
- APIs, databases, files (untrusted)
I read this diagram top to bottom, and you should too. Trust falls as you go down. The host ranks highest. Servers are only conditionally trusted. The web APIs, databases and file systems a server calls are untrusted from the protocol's point of view. So every arrow downward is a place to validate, and every arrow upward carries content you should not believe.
Let me place the attack classes now, and we will cover each properly in the next part. At boundary 1 you find prompt injection landing in the model and tool descriptions read as trusted context. At boundary 2 sit tool poisoning, rug pulls, sampling abuse and malicious local servers. At boundary 3 sit confused deputy, token passthrough and SSRF. If you want to see injection travelling through this path, read prompt injection through MCP.
π§ Quick check
Threat model: mapping attack classes to each boundary of the mcp attack surface
Hold one idea while you read this section: every attack on the mcp attack surface sits at a specific boundary. If you can name the boundary, you know where to put the control. The full beginner map lives in the MCP attack surface day 2 guide, and here we turn it into a working threat model.
I will reuse the three boundaries from the diagram: A is model and client, B is client and servers, C is servers and the systems behind them. One caution first. The MCP specification admits it cannot enforce its security principles at protocol level, so the controls are yours to build.
π Words I just used
Local servers, tokens and real CVEs in the MCP attack surface
Let me bring the mcp attack surface down to where it bites: the laptop on your desk and the tokens in your config. Two ideas matter here. Local servers run with your privileges, and tokens must only be accepted by the server they were issued for. For the full map, read the MCP attack surface beginner's map.
A local stdio server is a process your host starts on your machine. It inherits your user privileges, so a malicious startup command or payload gets the same access you have: files, SSH keys, environment variables. The spec guidance is to show the exact command, require approval, and sandbox the server. A localhost HTTP server has a second problem. A web page in your browser can reach it through DNS rebinding, where a hostile domain is re-pointed at 127.0.0.1 so the browser treats your local service as same-origin.
Now for tokens. MCP authorization builds on OAuth 2.1 with PKCE, and servers must accept only tokens valid for their own resources, using audience binding through the RFC 8707 resource parameter. Token passthrough means accepting a token issued to someone else and forwarding it downstream. That is forbidden because the downstream API may trust it as if your server had validated it, a confused deputy. I go deeper in the MCP OAuth security article.
π Words I just used
Next, the real cases. CVE-2025-6514 is a CVSS 9.6 command injection in mcp-remote: a malicious server's crafted authorization-endpoint URL could run commands on the connecting client. It was fixed in 0.1.16. CVE-2025-49596 is a CVSS 9.4 remote code execution flaw in MCP Inspector, which bound its proxy to 0.0.0.0 without authentication, so a malicious page could exploit it with DNS rebinding and CSRF. It was patched in 0.14.1.
The mcp-server-git chain (CVE-2025-68143, CVE-2025-68144 and CVE-2025-68145) combined a path validation bypass, an unrestricted git_init and argument injection in git_diff. Paired with the Filesystem MCP server, it gave remote code execution. Both official SDKs also lacked DNS rebinding protection for localhost-bound SSE and StreamableHTTP servers: TypeScript before 1.24.0 and Python before 1.23.0.
π§ Quick check
Demo: reviewing a rogue MCP server for your mcp attack surface
Let me show you the review habit that catches most poisoning before it connects. We treat a server's tool list as untrusted input, because the model reads names, descriptions and schemas as context, often before any tool is called. You do this in the intentionally vulnerable SecurityElites lab, never against a real server. I demonstrate, then you repeat it.
π§ Review a rogue server's tool list
A simple format. Your lab findings will differ.
Several servers await approval, so you can practise the review above on each one.
βΈ Read each description in full and note anything aimed at the model.
βΈ Compare each tool's scope to its stated purpose.
βΈ Look for servers that could change their definitions later.
βΈ Decide approve, reject or restrict, and write your reason.
What to notice: Which findings sit at which boundary How harmless a poisoned description can look
Detection: spotting exposure and abuse
Detection is where I see most teams thinnest, so let me show you four habits that close the visibility gap in your mcp attack surface. OWASP lists shadow MCP servers and lack of audit and telemetry among its MCP Top 10 risks, a beta-stage incubator project, so these are worth building first.
π§ Four detection habits
Run on your own saved files. Any difference means re-review before the server is trusted again.
π§ Quick check
See what a hostile description does to an agent, so you know what your diffs and logs are protecting.
βΈ Watch how the agent discovers tools at startup.
βΈ Note which text the agent treats as instructions.
βΈ Think about which log line would have shown the abuse.
What to notice: Descriptions act as context, not just labels Nothing flagged the change without a check
Reducing the mcp attack surface: defensive controls
Let me finish with what you can actually change. You cannot remove the mcp attack surface, because tools are arbitrary code and the specification admits it cannot enforce its own security principles at protocol level. Consent, authorization and access control are yours to build. So I have put the controls in priority order, and you can work down the list on your own setup. For the full map behind this list, read the MCP attack surface pillar guide.
π§ Controls in priority order
The image name is a placeholder. The point is the flags: no network, read-only filesystem, one read-only mount and a pinned version tag.
π§ Quick check
To turn this into a routine, follow the Securing AI Agents and MCP course and practise reviewing tools in the tool poisoning guide. Use the OWASP cheat sheet as your checklist, and keep the controls in place after launch.
Apply these controls as a reviewer: decide which servers to approve and which to refuse.
βΈ Read each server's tool names, descriptions and schemas as untrusted input.
βΈ Compare the scope each tool asks for with what its purpose needs.
βΈ Look for tools that could change after approval.
βΈ Write down which control above would stop each risk.
What to notice: Which servers ask for more access than their job needs Which descriptions contain instructions meant for the model rather than the user
Your Checklist
βοΈ MCP deployment review checklist
π« Mistakes I See Most Often
What I Want You to Remember
π§ Check Your Understanding
β Questions People Ask
What is the MCP attack surface?
What are the main trust boundaries in the Model Context Protocol?
How does MCP tool poisoning work, and how is it different from a rug pull?
Are local (stdio) MCP servers safe to run?
What is the confused deputy problem in MCP, and why is token passthrough forbidden?
Can MCP resources and tool outputs carry prompt injection?
What does the OWASP MCP Top 10 cover?
π§© More in the MCP Security series
- Start here: MCP Security 2027: Complete Model Context Protocol Security Guide β Learn mcp security from architecture to defence: map trust boundaries, spot tool poisoning and rug pulls,…
- MCP Tool Poisoning Attacks: Detection, Testing and Prevention β Learn mcp tool poisoning step by step: read malicious tool descriptions, test them in a safe…
- MCP Rug Pull Attacks: How Malicious MCP Servers Change Trusted Tools β Learn how mcp rug pull attacks swap trusted tool definitions after approval, then detect schema drift…
- MCP Server Security Checklist: 30 Essential Security Controls β Use this MCP server security checklist to audit configuration, authentication, permissions, logging and transport, and fix…
π Keep Learning on SecurityElites
- Agentic AI Security: Complete Guide to AI Agent Attacks, Risks and Defence β Learn agentic ai security end to end: map agent attack surfaces, model threats, hijack a lab agent, and…
- Agentic AI security: what the OWASP lists mean for your data β Agentic AI security and the OWASP lists explained in plain words: how AI agents get hijacked, who is…
- Day 6: Persistence and Exfiltration: Memory, Plans and Data Leaks β Learn how an injection persists in agent memory and leaks data through tools, then trace the outbound path…
- Day 1: What an Agent Is and Why It Is Risky β Learn the parts of an AI agent, set up your terminal, and complete your first prompt injection in…
- Securing AI Agents and MCP: Hijacking, Poisoning and Lockdown β Learn how AI agents get hijacked, how MCP tools get poisoned, and how to review and lock down…
π Sources I Checked
- MCP Security Best Practices Explained: What the Official Spec Requires, Who Has to Implement It, and What IT Can Enforce on Employee Laptops
- Specification – Model Context Protocol
- Security Best Practices – Model Context Protocol
- mcp-for-beginners/02-Security/mcp-security-best-practices.md at main Β· microsoft/mcp-for-beginners Β· GitHub
- Model Context Protocol (MCP) Explained: Messages, Transports, Auth
- OWASP MCP Top 10 Explained for IT and Security Teams: Which of the 10 Risks an Endpoint Can Actually Control
- MCP Security: Tool Poisoning and Prompt Injection
- MCP Attack Surface: Tool Poisoning and IDE Auto-Execution
Written by Mr Elite. Reviewed by Mr Elite, last reviewed on .

