Lesson 3 of 610 minReviewed
How MCP works, and how MCP servers go wrong
Understand the MCP host, client and server roles, then recognise tool poisoning, shadowing, rug pulls, malicious servers and vulnerable bridges, and the controls that contain them.
The Model Context Protocol connects a host application, such as an IDE, a desktop app or a CLI agent, to servers that expose tools, resources and prompts. The host runs one client per server. Tools are model-controlled: the client fetches each server's tool names, descriptions and schemas with tools/list, places them in the model's context, and calls tools/call when the model chooses one [1].
Two facts from the project's own security guidance shape everything else. A local server launched over stdio is an ordinary child process: it inherits your environment variables, can read whatever your account can read and can connect anywhere [2]. And the client and a stdio server share one trust domain; neither the protocol nor the SDKs defend one against the other [2].
The threats
| Threat | What happens |
|---|---|
| Tool poisoning | Instructions hidden in a tool description that the model reads and the user typically does not see, steering it to read and leak files [3] |
| Tool shadowing | One server's description changes how the agent uses another server's tool, for example redirecting mail sent through a trusted email tool [3]. It works because all configured servers share the model's context [2] |
| Rug pull | A server changes its tool definitions after you approved it, so a one-time consent dialog and version pinning do not cover this surface [2, 3] |
| Malicious or overcollecting server | Typosquatted names, lookalike repositories or taken-over projects that work as advertised while collecting environment variables or files [2] |
| Compromised dependency | An honest server pulls in a package that was compromised upstream [2] |
| Vulnerable server or bridge | A legitimate component is the way in, often triggered just by connecting to a malicious endpoint or visiting a web page [2] |
The last row has concrete cases. CVE-2025-6514 in mcp-remote versions 0.0.5 to 0.1.15 (CVSS 9.6) let a malicious server's OAuth authorization_endpoint value reach the operating system, giving command execution on Windows; 0.1.16 fixed it [4]. CVE-2025-49596 in MCP Inspector before 0.14.1 (CVSS 9.4) let a web page reach the Inspector's local proxy and start commands; the fix added a session token and origin checks [5]. Approval logic can fail too: Check Point showed that Cursor tied trust to an MCP entry's name, so an approved entry's command could later change without a new prompt (CVE-2025-54136, fixed in Cursor 1.3) [6].
Controls that contain a bad server
- Inventory and remove. Know every server in every client configuration and delete the ones nobody uses [2].
- Prefer the remote version when a server only wraps an internet API; it runs no code on your machine and uses the protocol's authorisation flow [2].
- Check provenance and pin. Identifiable publisher, exact package name, a pinned version. A version pinned through
npxoruvxfixes only the top-level package; an image digest freezes the whole dependency tree [2]. - Isolate. Run third-party servers in a container with nothing mounted except the directory they need, and with
--network=nonewhen they need no network [2]. - Treat descriptions as input. Read tool descriptions before relying on a server, and prefer clients that record definitions and ask again when they change [2]; Invariant suggests hashing descriptions to detect changes [3].
- Patch local plumbing. Binding to 127.0.0.1 is not authentication; bridges and developer tools that listen on a port need real authentication, origin checks and prompt updates [2].
Try it on ThreatDeck
- MCP Server Watch Look up a server you run: repository facts, advisories that affect the shipped version, signals.
- threatdeck scan Inventory MCP servers across local clients and flag unpinned or risky entries, without uploading configs.
- AI Agent Tool Poisoning (ATLAS) The ATLAS technique, with stories and detections linked to it.
- Detection: MCP config modified by an unexpected process Catch a rogue process adding or editing servers in a client configuration.
Self-check
4 questionsPick an answer to see whether it is right and why. Only your score is saved, in this browser.
-
A rug pull exploits the gap between a one-time approval and a definition that can change at runtime. Pinning the package version does not help if the server serves new descriptions.
-
Shadowing works through the model, not the network. Every description the model reads can shape every decision, which is why each added server widens the surface for the others.
-
Launcher pins fix the named package only. Freezing the full tree needs a lockfile you control or a container image pinned by digest.
-
A web page could reach the local proxy and start commands. The fix added a session token and origin validation, matching the guidance that 127.0.0.1 is not an authentication boundary.
References
- MCP specification: Tools (2026-07-28). Model Context Protocol, 2026-07-28.
- MCP Local Server Security. Model Context Protocol, 2026-07-28.
- MCP Security Notification: Tool Poisoning Attacks. Invariant Labs, 2025-04-01.
- CVE-2025-6514 Threatens LLM clients (critical mcp-remote RCE). JFrog Security Research, 2025-07-09.
- Critical RCE in Anthropic MCP Inspector (CVE-2025-49596) Enables Browser-Based Exploits. Oligo Security, 2025-06-27.
- Cursor IDE's MCP Vulnerability (MCPoison, CVE-2025-54136). Check Point Research, 2025-08-05.