# MCP Tool Poisoning Attacks (Invariant Labs)

- ID: invariant-mcp-tool-poisoning-2025-04
- Reported: 2025-04-01
- Researcher: Luca Beurer-Kellner, Marc Fischer
- Organization: Invariant Labs
- AI role: ai_agent_or_mcp_as_target (Agent / MCP as target)
- Confidence in AI involvement: not assessed
- Research / borderline: false
- Last reviewed: 2026-10-20
- Entry page: https://openattacks.ai/attacks/invariant-mcp-tool-poisoning-2025-04/
- Entry JSON: https://openattacks.ai/api/attacks/invariant-mcp-tool-poisoning-2025-04.json
- Browse title: MCP tool poisoning attacks (Invariant Labs)
- Editorial summary: Research showed hidden instructions in MCP tool descriptions can make agents leak SSH keys and configs. It also showed rug pulls and cross-server email redirection.
- Evidence class (catalog annotation): Research demonstration
- Source-stated target environments: Agents & MCP
- Stage hunts and conditional defenses: https://openattacks.ai/api/defenses/invariant-mcp-tool-poisoning-2025-04.json

## Technique
Malicious MCP tool descriptions hide instructions only the model sees (e.g., read ~/.ssh/id\_rsa and mcp.json into sidenote params). Also demonstrated rug pulls (change description after approval) and cross-server shadowing that redirects trusted send\_email tools to attacker addresses. Affects Cursor and other MCP clients.

## Stack relevance (editorial)
Assessment: mapped. Editorial applicability reviewed against the catalog source account; not a scan or independent incident verification.
First action: Inspect complete tool descriptions, review changes after approval and isolate each server’s permissions.
- Relationship: target; tools: cursor; OS scope: not OS-specific / not stated; requires existing MCP connections: true.
  Relevance: The research demonstrates tool poisoning against Cursor and other MCP clients.
  Condition to check: An agent must consume malicious or changed MCP tool descriptions and be able to access the relevant files or tools.
  Condition to check: This entry describes research demonstrations, not a confirmed campaign against every MCP user.
  Evidence: https://invariantlabs.ai/blog/mcp-security-notification-tool-poisoning-attacks
- Relationship: workflow; tools: no specific product; OS scope: not OS-specific / not stated; requires existing MCP connections: true.
  Relevance: MCP tool descriptions are an untrusted input to the agent in this research.
  Condition to check: Review server provenance, tool-description changes and access to files, secrets or email tools.
  Condition to check: The research demonstrates a failure mode; it does not identify every connected MCP server as malicious.
  Evidence: https://invariantlabs.ai/blog/mcp-security-notification-tool-poisoning-attacks
A product mention alone is not a victim-side applicability mapping. Selection does not verify affected versions, permissions or compromise.

## Initial access
User connects agent to malicious or rug-pulled MCP server

## AI tooling and models
- MCP tool descriptions
- [Cursor](https://cursor.com/) and other MCP clients

## Other tooling
- unknown

## Victims and sectors
unknown

## Target geography
- unknown

## Attribution
unknown

## Scale and metrics
unknown

## Attack flow
Catalog reconstruction of the supplied source account. Unknowns and research caveats are preserved.
### step-1: A malicious MCP server is connected [access]
The user adds a server or trusts one that later changes.
Evidence: https://invariantlabs.ai/blog/mcp-security-notification-tool-poisoning-attacks

### step-2: Tool descriptions carry hidden instructions [ai]
Instructions are visible to the model and may shadow another server’s tools.
Evidence: https://invariantlabs.ai/blog/mcp-security-notification-tool-poisoning-attacks

### step-3: Agent reads files or redirects a tool [execution]
The demonstrations induce sensitive-file reads and manipulate email destinations.
Evidence: https://invariantlabs.ai/blog/mcp-security-notification-tool-poisoning-attacks

### step-4: Sensitive data is sent to the attacker [impact]
Tool arguments or redirected operations carry information across the trust boundary.
Evidence: https://invariantlabs.ai/blog/mcp-security-notification-tool-poisoning-attacks

Connections:
- step-1 -> step-2
- step-2 -> step-3
- step-3 -> step-4

## Stage defense and hunting recommendations
Editorial recommendations, not validated coverage. Source-controlled query starters are drafts. Custom-schema examples require telemetry collection and field mapping; absence of a mapping means not assessed. MagicSword policy opportunities require managed Windows scope and enforcement.
### step-1: Agent trust / configuration changes
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/mcp-config.sigma.yml
- KQL query download: /api/detections/mcp-config.kql
- SPL query download: /api/detections/mcp-config.spl
- Hunt hypothesis: A repository, dependency or agent changes MCP commands, automatic-task settings, tool approval or model-routing configuration before new execution.
- Required telemetry: File changes and before/after content for MCP / IDE configuration; Repository audit / pull-request history; Agent startup and tool-invocation logs
- Investigate: Diff command, args, environment, origin, autoApprove and task settings against the previously approved version.
- Investigate: Correlate the author and change with the next agent launch; inspect path canonicalization and trailing-dot variants where relevant.
- Limitation: A file-write event alone cannot establish what changed. Legitimate setup also changes these files; obtain a diff and authorization context.
- Qualification: Compare newly connected server origins and configuration with the approved inventory; later tool-description changes need agent audit.
- No direct MagicSword prevention claim is recorded for this stage.

### step-2: Unexpected agent tool use
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/agent-tools.sigma.yml
- KQL query download: /api/detections/agent-tools.kql
- SPL query download: /api/detections/agent-tools.spl
- Hunt hypothesis: Untrusted content or a changed tool definition precedes a file read, command, or remote call outside the user's intended task.
- Required telemetry: Agent tool-call audit records with session / tool / destination; Tool-definition and approval changes; Endpoint process, file-access and network evidence where available
- Investigate: Join input provenance, tool descriptions and calls by session ID and compare the action to the approved task.
- Investigate: Inspect child processes and destinations; record whether execution was in-process, local, or through a remote SaaS connector.
- Limitation: Process logs cannot recover model intent. Remote connectors and in-process interpreters may produce no local child process. Prompt content alone is not a reliable signature.
- No direct MagicSword prevention claim is recorded for this stage.
- Community intelligence: LOLSkills — https://lolskills.io

### step-3: Sensitive store access → credential use
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/credentials.sigma.yml
- KQL query download: /api/detections/credentials.kql
- SPL query download: /api/detections/credentials.spl
- Hunt hypothesis: An unexpected process or tool accesses credential stores and is followed by token use or outbound transfer inconsistent with the owner.
- Required telemetry: File-read / API access telemetry for relevant secret stores; Process identity and command lines; Identity, token and outbound-network audit logs
- Investigate: Identify the actor, process and exact store touched, then pivot to token use from new devices or infrastructure.
- Investigate: Correlate reads with egress and rotate affected credentials after confirming exposure.
- Limitation: Defender DeviceFileEvents is not a general file-read audit trail. Collect suitable object-access, EDR or application logs; legitimate developer tools also read secrets.
- No direct MagicSword prevention claim is recorded for this stage.

### step-4: Sensitive data → unusual destination
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/exfil.sigma.yml
- KQL query download: /api/detections/exfil.kql
- SPL query download: /api/detections/exfil.spl
- Hunt hypothesis: Sensitive reads are followed by outbound transfer, a public artifact, or a tool call to a destination outside the approved workflow.
- Required telemetry: Sensitive resource access / DLP records; Proxy, egress and cloud upload events; Agent / SaaS audit with correlation IDs
- Investigate: Join the resource read and outbound action by session, identity or process, preserving a bounded time window.
- Investigate: Inspect destination ownership, payload classification and the user's intended action; baseline sanctioned sharing.
- Limitation: An outbound connection or high byte count alone is not exfiltration. Encrypted traffic may hide content, and bulk legitimate exports are common.
- No direct MagicSword prevention claim is recorded for this stage.


## MITRE ATLAS
Mappings are catalog annotations based on described behavior, not assignments or endorsements by MITRE.
- AML.T0051.001: Indirect — Tool descriptions contain indirect model instructions.
  Technique: https://atlas.mitre.org/techniques/AML.T0051.001
  Evidence: https://invariantlabs.ai/blog/mcp-security-notification-tool-poisoning-attacks
- AML.T0109: AI Supply Chain Rug Pull — A trusted server can change its behavior after approval.
  Technique: https://atlas.mitre.org/techniques/AML.T0109
  Evidence: https://invariantlabs.ai/blog/mcp-security-notification-tool-poisoning-attacks
- AML.T0086: Exfiltration via AI Agent Tool Invocation — The demonstrations exfiltrate through tool arguments or redirected tools.
  Technique: https://atlas.mitre.org/techniques/AML.T0086
  Evidence: https://invariantlabs.ai/blog/mcp-security-notification-tool-poisoning-attacks

## Defensive notes
Show full tool descriptions; pin tool hashes; isolate MCP servers; least privilege

## Sources
- https://invariantlabs.ai/blog/mcp-security-notification-tool-poisoning-attacks
