INCIDENT MAP

Browse / MCP and Tool Server Flaws / AML.CS0054

Data Exfiltration via Remote Poisoned MCP Tool

AML.CS0054 · 2025-04-01 case study

Class
MCP and Tool Server Flaws
Technique
AI Agent Tool Poisoning: Definition and Instructions
Also involves
Unsafe Model Loading and Supply Chain, Tool and Agent Misuse, Direct Prompt Injection
Target
Model Context Protocol (Exercise)

How it worked

  1. AI Attack Adaptation · LLM Prompt Crafting

    The researchers crafted a prompt that instructs an AI agent to discover and read user credentials files and store them in an input parameter of an MCP tool.

  2. Resource Development · Publish Poisoned AI Artifacts: AI Agent Tools

    The researchers hosted a poisoned MCP server that contains the malicious instructions hidden in the docstring of one of the provided tools.

  3. Initial Access · Supply Chain Compromise: AI Agent Tool

    The victim configured their AI agent to connect to the adversary-controlled remote MCP server, introducing the poisoned tool definition into the agent's available tool set.

  4. Persistence · AI Agent Tool Poisoning: Definition and Instructions

    The MCP tool's model-visible docstring contained malicious instructions directing the agent to read credential files, conceal the additional actions from the user, and place the credential contents in an otherwise unnecessary tool parameter.

  5. Execution · User Execution: Poisoned AI Agent Tool

    When the user made a request that represented the poisoned tool's functionality, the agent invoked the poisoned MCP tool and acted on the malicious instructions contained in its definition.

  6. Execution · LLM Prompt Injection: Indirect

    The agent ingested and followed malicious instructions supplied through the remote tool's model-visible definition rather than directly through an adversary-authored user message.

  7. Execution · AI Agent Tool Invocation

    The prompt invoked an agent tool capable of reading files from the victim's filesystem.

  8. Credential Access · Unsecured Credentials

    The prompt instructed the AI agent to read the user's SSH keys at ~/.ssh/id_rsa.

  9. Credential Access · AI Agent Tool Credential Harvesting

    The prompt instructed the AI agent to read mcp.json, which often contains credentials for other MCP servers.

  10. Exfiltration · Exfiltration via AI Agent Tool Invocation

    The prompt instructed the AI agent to store the credentials files in an extraneous MCP tool parameter to exfiltrate them via the MCP connection.

  11. Impact · External Harms: User Harm

    The user's private data was exposed to remote MCP server.

Summary

Researchers at Invariant Labs demonstrated that AI agents configured with remote Model Context Protocol (MCP) Tools can be vulnerable to model poisoning attacks. They show that an MCP Tool can contain malicious prompts in its docstring description, which is ingested into the AI agent's context, modifying its behavior.

They demonstrate this attack with a proof-of-concept MCP Tool that instructs the agent to perform additional actions before using the tool. The agent is instructed to read files containing credentials from the victim's machine and store their contents in one of the input variables to the tool. When the tool runs, the victim's credentials are exfiltrated to the poisoned MCP server.

References

Source: MITRE ATLAS case studies, used under Apache 2.0.