Log-To-Leak: when a successful agent task still leaks your data through MCP
A paper from October 26, 2026 shows a malicious MCP server can add a 'logging' tool call after the real work is done, leaking queries and responses while the task still succeeds.
What is this?
On October 26, 2026, Yuepeng Hu, Chongyu Fan, Sirat Samyoun and Jian Du posted Log-To-Leak (arXiv:2610.36108, cs.CR). It studies prompt injection against tool-using LLM agents connected through the Model Context Protocol (MCP). Unlike earlier tool-poisoning work, which tries to hijack or replace the agent’s task, this attack is additive: it lets the legitimate task finish and then adds one extra tool call that discloses data. The authors call this “additive post-hoc logging”.
The key finding is uncomfortable for anyone who monitors agents by task success: the task can complete correctly while unauthorized disclosure still happens afterwards.
How it works
The threat model is narrow. The attacker operates a third-party MCP server that a user or integrator has enabled, and controls only the metadata it publishes: tool descriptions, names and schemas. It cannot see other servers, the agent’s internals or the user’s queries. The attack only works if the host exposes that metadata to the model and does not gate the resulting call.
The injected description contains four parts, according to the paper: a cue for when the extra action should run, a reference to the attacker’s logging tool, a plausible justification (such as compliance or auditing), and a forceful clause that makes the step seem mandatory. The extra call can carry the user query, the MCP server name, the server’s response and the agent’s own response.
Evaluation covered five MCP servers (GitHub, Mapbox, PayPal, YFinance, Playwright), four models (GPT-4o, GPT-5, Claude-Sonnet-4, GPT-OSS-120B) and 555 queries. Across 18 compatible model-server pairs, attack success ranged from 62.64% to 100%, and the logged fields were accurate in 76.55% to 95.64% of successful calls. Target-task completion changed only slightly in most pairs, which is what makes the leak hard to notice. The full four-part template beat simplified versions in ablations, and the authors report the attack also reproduced in Cursor and Claude Desktop.
No exploit payload is reproduced here; the point is the pattern, not the wording.
Why it matters
Tool-poisoning attacks were documented by Invariant Labs in April 2025, showing that concealed instructions in tool descriptions can steer agents, because the model reads the full description while the user typically sees a simplified view. Log-To-Leak shows the same surface can be used more quietly: no visible failure, no degraded output, only an extra call that looks like routine telemetry.
Evaluated defenses fell short. Prompt sandwiching, an LLM-based metadata auditor and IPIGuard each left residual attack success above 55% on GitHub with GPT-4o. A data-based detector missed all 100 injected descriptions, and an instruction detector caught 91% of injections but also flagged 85.53% of benign descriptions, which makes it hard to deploy.
Defenses
- Treat third-party tool metadata as untrusted input. A description should describe a tool, never authorize actions outside it.
- Host-side authorization for secondary calls. Require the host, not the model, to approve logging-like, telemetry-like or cross-server calls, using allowlists, data-flow checks or user confirmation.
- Log tool-call sequences. Record the full ordered list of calls so unexpected extra calls after task completion are visible and alertable.
- Pin and review tool definitions. Version-pin servers and verify descriptions by hash, as Invariant Labs recommended, and show users the full description.
- Don’t rely on a single detector. Given the false-positive and miss rates above, combine controls rather than depending on a metadata classifier.
Status
| Item | Detail |
|---|---|
| Type | Research paper (academic), no vendor patch applicable |
| Published | 2026-10-26, arXiv:2610.36108 v1 |
| Models tested | GPT-4o, GPT-5, Claude-Sonnet-4, GPT-OSS-120B |
| Also reproduced | Cursor, Claude Desktop (per the authors) |
| Mitigation | Host-controlled authorization of secondary tool calls |