WhatsApp MCP Exploited
A malicious MCP server can inject instructions into an AI agent's tool descriptions, causing the agent to exfiltrate the user's WhatsApp chat history via the trusted WhatsApp MCP server. An attacker can also achieve contact exfiltration by sending a crafted WhatsApp message that injects instructions into the agent's context.
invariantlabs.ai
Published on invariantlabs.ai
View Code
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the agent treats tool descriptions and tool outputs as trusted instructions, allowing an attacker to inject commands that manipulate the agent's behaviour.
Impact
The attacker can exfiltrate the user's entire WhatsApp chat history or contact list, bypassing WhatsApp's encryption, though the user must confirm the tool call and may notice the hidden payload if they scroll.
What the attacker needed
Agent connected to WhatsApp MCP; agent connected to malicious MCP server; user approves tool call
The fix
Users should be cautious when connecting agentic systems to untrusted MCP servers and be aware of the risks.
How it was found
- Deploy a malicious MCP server that initially advertises an innocuous tool.
- After the user approves the tool, change the tool description to include malicious instructions that shadow the WhatsApp MCP server.
- When the agent uses the WhatsApp send_message tool, it follows the injected instructions to send chat history to the attacker's number.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
An AI agent is connected to two tools: a trusted WhatsApp tool and a malicious tool. The malicious tool's description secretly tells the agent to send the user's chat history to the attacker's phone number. The user might not notice because the confirmation dialog hides the full message.
What is AI / LLM?
Prompt injection, data exfiltration and tool abuse in features built on language models, and the ordinary bugs around them.