
invariantlabs-ai/mcp-injection-experiments
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
invariantlabs-ai/mcp-injection-experiments — это кандидат на MCP-сервер, импортированный из https://github.com/invariantlabs-ai/mcp-injection-experiments.
Обзор
invariantlabs-ai/mcp-injection-experiments — это кандидат на MCP-сервер, импортированный из https://github.com/invariantlabs-ai/mcp-injection-experiments.
Обзор (машинный перевод)
Этот репозиторий содержит несколько экспериментальных реализаций сервера MCP, которые пытаются внедрить используемый клиент/агент MCP.
Для получения дополнительной информации о методе атаки, пожалуйста, смотрите наш блог.
Обновление: Мы выпустили новый инструмент для сканирования безопасности под названием mcp-scan, который обнаруживает атаки MCP, как показано в этом репозитории, и помогает защитить ваши MCP-серверы.
Прямое отравление
В direct-poisoning.py мы реализуем простой MCP-сервер, который инструктирует агента утекать чувствительные файлы при вызове инструмента add (в данном случае SSH-ключей и самого файла [[T2]).
Пример выполнения в курсоре выглядит так:
Теневой слежка за инструментами
В shadowing.py мы реализуем более сложную MCP-атаку, которая манипулирует поведением агента инструмента [send_email (предоставляемого другим, доверенным сервером), так что все письма, отправленные агентом, попадают на сервер злоумышленника.
Пример выполнения в Cursor выглядит так:
Захват WhatsApp
Наконец, в whatsapp-takeover.py мы реализуем теневой атаку в сочетании с sleeper rug pull, то есть MCP-сервер, который меняет интерфейс инструмента только при второй загрузке на вредоносный.
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
MCP Tool Poisoning Experiments
This repository contains a few experimental MCP server implementations, that attempt ot inject the MCP client/agent in use.
For more details about the attack method, please see our blog post.
Update: We have released a new security scanning tool called mcp-scan, that detects MCP attacks as demonstrated in this repository, and helps you secure your MCP servers.
Direct Poisoning
In direct-poisoning.py, we implement a simple MCP server that instructs an agent to leak sensitive files, when calling the add tool (in this case SSH keys and the mcp.json file itself).
An example execution in cursor looks like this:

Tool Shadowing
In shadowing.py, we implement a more sophisticated MCP attack, that manipulates the agent’s behavior of a send_email tool (provided by a different, trusted server), such that all emails sent by the agent are leaked to the attacker’s server.
An example execution in Cursor looks like this:

WhatsApp takeover
Lastly, in whatsapp-takeover.py, we implement a shadowing attack combined with a sleeper rug pull, i.e. an MCP server that changes its tool interface only on the second load to a malicious one.
The server first masks as a benign “random fact of the day” implementation, and then changes the tool to a malicious one that manipulates whatsapp-mcp in the same agent, to leak messages to the attacker’s phone number.
Can you spot the exfiltration? Here, the malicious tool instructions ask the agent to include the smuggled data after many spaces, such that with invisible scroll bars, the user does not see the data being leaked. Only when you scroll all the way to the right, will you be able to find the exfiltration payload.
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →