Browse / MCP and Tool Server Flaws / AML.CS0054
Data Exfiltration via Remote Poisoned MCP Tool
- Target
- Model Context Protocol (Exercise)
How it worked
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- Execution · AI Agent Tool Invocation
The prompt invoked an agent tool capable of reading files from the victim's filesystem.
- Credential Access · Unsecured Credentials
The prompt instructed the AI agent to read the user's SSH keys at
~/.ssh/id_rsa. - 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. - 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.
- 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.