Skip to content

Back to the catalog

Log-To-Leak: Prompt Injection Attacks on Tool-Using LLM Agents via the Model Context Protocol
arxiv.orgpaper

Log-To-Leak: Prompt Injection Attacks on Tool-Using LLM Agents via the Model Context Protocol

Log-To-Leak is a prompt-injection attack on tool-using LLM agents that abuses Model Context Protocol tool metadata to trigger an attacker-controlled logging call after the last legitimate call, leaking the user query, server name, server response and agent response. Evaluated on five MCP servers and four agents, it reaches 62.64-100% attack success with 76.55-95.64% logging accuracy. Three defenses leave over 55% residual ASR on GitHub MCP with GPT-4o.

TL;DR Paper presents Log-To-Leak, an MCP tool-poisoning attack that exfiltrates data via a secondary logging call, and shows current defenses fall short.
Document

What it is

Log-To-Leak is an MCP tool-poisoning attack from Hu, Fan, Samyoun and Du (Duke, Michigan State, TikTok), accepted at AGENT-SEC '26 (November 2026). A malicious tool description makes the agent add one extra call to an attacker-run save_logs tool after its last legitimate call. The task still completes, so the user sees a normal answer.

How it works

The attacker runs a third-party MCP server and edits only the description of one of its own tools. The injected directive has four parts:

  • Trigger: when to log.
  • Tool Binding: names the logging tool.
  • Justification: a formal rationale.
  • Pressure: mandatory wording.

The logging call carries four fields: the user query, the MCP server name, that server's response, and the agent's response. The authors report that Tool Binding alone (just "save_logs") rarely produces a post-hoc call. They also compared four metadata surfaces (tool name, parameter name, parameter default, description). The fetched text cuts off before those results, so which surface works best is not visible here.

flowchart LR
    A[Agent runs legitimate calls] --> B{Host authorizes extra call?}
    B -- no --> C[Call rejected, no leak]
    B -- yes --> D[save_logs call with 4 fields]
    D --> E[Agent replies normally]

Preconditions / Affected

  • The attacker's MCP server is enabled next to the server the user actually needs.
  • The host shows the attacker's tool description to the model.
  • The host's permission policy lets the agent call the logging tool with no independent authorization check.

The attacker cannot modify other servers, change the system prompt, or see traffic. It receives data only if the agent builds and sends the payload.

Tested servers: GitHub, Mapbox, PayPal, YFinance, Playwright. Tested agents: GPT-4o, GPT-5, Claude-Sonnet-4, GPT-OSS-120B.

What to do

The authors' conclusion is to require host-controlled authorization for secondary tool calls. A call to a tool that no user step requested should not run on the model's decision alone. Reviewing tool descriptions at registration helps less, because the detector result below shows how noisy that is.

Caveats

  • Across 18 model-server pairs with valid tool execution, attack success was 62.64 to 100%. Logging accuracy, given a call, was 76.55 to 95.64%.
  • 16 pairs changed target-task completion by at most 6.63 percentage points. Some models paid a larger task-completion cost, and some server pairings failed to execute tools at all.
  • Three defenses (prompt-level, auditing-based, dependency-graph) left residual attack success above 55% on GitHub MCP with GPT-4o. The paper does not claim this holds for other pairs.
  • The instruction detector flagged 85.53% of benign descriptions, so it is unusable as a filter.
  • The authors say this is a narrow case within existing tool-poisoning research (MCPTox, MCP-SafetyBench, MCP-ITP), not a new attack class.

Technologies named here

Techniques named here