ToFu: exploiting and fuzzing the trust boundary between LLM orchestrators and toolsToFu: Exploiting and Fuzzing the LLM-Orchestrator-Tool Trust Boundary
ToFu performs semantic fuzzing from tool metadata, and found 253 bugs across 273 MCP servers.
Attackers can influence user prompts, retrieved content, and other tool outputs consumed by LLMs; this information may enter structured parameters, so every schema-valid parameter is treated as potentially adversarial. Assumes orchestration layer faithfully exposes declared interfaces and dispatches calls. Trusts ToFu infrastructure, not LLM and tool implementations. Vulnerability means the tool accepts or processes the parameter, thereby violating safety properties implied by the documented interface.
- The orchestration layer executes the LLM's structured output as tool calls, but the semantic constraints promised by tool documentation are often not enforced in the implementation. If LLM-generated parameters are treated as trusted input, adversarial values such as paths, URLs, and commands can reach security-sensitive operations.
- ToFu uses tool metadata to map parameters to 74 CWE sanitizers; LLM only does mapping and initial seeds, not adjudication. Atheris does coverage-guided fuzzing on schema-valid calls; reads tracers when visible, otherwise uses outcome oracle to see if inputs that should be rejected are accepted.
- On 273 executable MCP servers and 3405 tools, manual review found 253 bugs across 343 tools in 118 servers. A 60-second budget found 231. The flags from five baselines do not fully overlap with ToFu; 8 servers were flagged only by ToFu.
- Authors leave multi-agent, third-party component coverage, and stateful calls for future work. Static probes are not tested for precision and cannot see dynamically constructed calls. Evaluation is on 273 Python/JS MCP servers; tracers are only in Python. Paper does not report manual review consistency.
- Benchmarks
- MCPCorpus273个可执行MCP server(提取3405个tool)
- Metrics
- verified bugscandidate bugsflagged servers
The researchers propose ToFu, a fuzzing framework for LLM tools, which automatically derives semantic security checks from tool metadata and a CWE-guided sanitizer corpus, and generates schema-conforming fuzzing harnesses and semantic oracles. After evaluating on 273 MCP servers and 3405 tools, ToFu confirmed 253 reproducible defects in 343 tools across 118 servers, including 115 reflected output, 64 path traversal, 58 log injection, 7 SSRF, etc. These defects mostly occur when tools return normally and do not manifest as crashes. The authors also propose the Repeat-After-Me attack, which induces the LLM to verbatim repeat attacker-constructed tool call text, and the orchestration layer dispatches and executes it as a request, showing that conforming to the tool call schema does not mean the request is trustworthy.
Why it was selectedToFu automatically derives safety semantic checks from tool metadata and performs fuzzing, providing a transferable method for self-auditing MCP tool implementations.
Related events and news
1 events · 2 news mentions
News that mentions this paper
Check Point 披露 ChatGPT Lockdown Mode 绕过漏洞,OpenAI 已修复
- The Hacker Newscites the paper's id or link研究人员绕过 ChatGPT Lockdown Mode 无需用户交互即可窃取聊天数据
A technique called Repeat-After-Me that targets LangChain LangGraph, Microsoft Agent Framework, Microsoft AutoGen, Google Agent Development Kit 2.0, AWS Strands Agents, and CrewAI and tricks them
- 先知社区cites the paper's id or linkRepeat-After-Me:Agent结构化工具调用的绕过与防护实践
Paper analysis
What problem does this paper attempt to solve?
The authors state that orchestration layers treat model outputs as tool calls, while tools often do not enforce the semantic constraints in documentation.
Whether tools treat potentially attacker-influenced LLM parameters as trusted input, thereby failing to enforce the semantic security constraints promised by documentation.
- Scenario: The orchestration layer provides tool descriptions and parameter schemas to the LLM, then dispatches structured tool calls for execution (§1–§2). The authors argue that schema compliance does not make requests trustworthy; without authentication, the execution phase must treat LLM-generated parameters as untrusted.
- Existing gaps: The authors state that existing analyses focus on predefined weaknesses, specific taint flows, or specific agent–tool attacks, with coverage limited by pre-encoded threats (§3, §5). Crashes, memory safety, and assertions cannot catch executions that return successfully but access resources outside the workspace or connect to forbidden destinations (§2.2).
- Observation: The authors argue that metadata guiding model tool use can also guide fuzzers. Parameters that are both strings may represent SQL versus URLs, requiring different adversarial inputs and security checks (§1).
- This paper proposes: ToFu derives semantic checks for individual tools from existing metadata and 74 CWE-oriented sanitizers, and automatically generates harnesses and oracles (§1, §6).
- Threat model (§4):
- Goal: Find cases where tools accept or process adversarial parameters, thereby violating security properties implied by their documented interfaces.
- Assumptions: The orchestration layer faithfully exposes declared interfaces and dispatches schema-valid calls. ToFu's analysis infrastructure is trusted; the LLM and tool implementations are not. The paper does not use white-box or black-box to describe this attacker.
- Capabilities: The attacker can influence user prompts, retrieved content, and other tool outputs consumed by the LLM; this information may enter parameters, so every schema-valid parameter is treated as a potential adversarial input.
- Victim and Repeat-After-Me: The victim is the tool implementation. Knowing the tool-call format, the attacker can have the LLM verbatim repeat specified tools and parameters, and the orchestration layer may still dispatch them. The authors state they reproduced this behavior on six orchestration layers: LangGraph, MAF, ADK 2.0, AutoGen, Strands, and CrewAI (§1).
What related research exists?
Related work often starts from known weaknesses or attacks; the authors say ToFu derives checks from parameter documentation.
The authors position this paper as starting after adversarial values have already reached tools, rather than inducing models to generate malicious values (§3).
Model behavior and tool selection
- Prompt injection and tool selection: Zou et al. (2023) adversarial suffixes, Greshake et al. (2023) indirect prompt injection, and WebInject (Wang et al., 2025) alter content the model sends to tools. ToolHijacker (Shi et al., 2026) and MPMA (Wang et al., 2026) change the selected tool by impersonating or overpowering legitimate descriptions.
- Cross-tool contamination: Les Dissonances (Li et al., 2026) examines when one tool's output contaminates another tool's parameters. The authors state that the above work manipulates agent decisions, and ToFu starts where they end.
Defenses and the MCP ecosystem
- Defense ideas: Filter and locate injected content, train models to follow instruction hierarchies, and narrow agent permissions. Model-Carrying Code (Sekar et al., 2003) lets untrusted code carry a security behavior model for hosts to check against policy; the authors suggest it could also apply to untrusted tool calls.
- Ecosystem description: The paper lists MCP surveys and taxonomies, MCPXKIT unifying 31 attack methods, Song et al.'s supply chain tracking, Ding et al.'s proof and expired capability leases, Rostamzadeh et al.'s research on "benign first, trusted later," and AEGIS for cross-domain resource abuse. This is descriptive, without per-paper comparison to ToFu.
MCP scanners
- Fixed lists: MCP at First Glance, MCP-SecLint, ATR's regex rules, and CodeQL sec-extended match known patterns or fixed queries. MCP-Scanner executes tools against a known threat catalog, and MCPSecBench turns such catalogs into benchmarks.
- Runtime measurement and protection: Cisco MCP Scanner uses YARA on metadata, has an LLM judge descriptions, and compares data flow with docstrings. FlowGuard, He et al., and MCP-Guard protect during use. The paper states that Chen et al. found large disagreements among scanners. In §5, the authors state that these systems are effective for encoded threats, but coverage is limited by pre-envisioned vulnerabilities.
Trust inconsistency and fuzzing
- Description–code: Li et al. (2026) discuss agent behavior under misleading tool descriptions; DCIChecker (Shi et al., 2026) detects mismatches between descriptions and code on real MCP servers.
- VIPER-MCP and ToolFuzz: VIPER-MCP first finds CodeQL taint flows, then uses an LLM agent to deliver attacker values to sinks; the authors state it covers only command injection, SSRF, and path traversal, leaving sink properties outside the list. ToolFuzz generates queries from documentation and runs agents, reporting runtime errors and inconsistent answers rejected by an LLM judge; the authors state it tests correctness rather than security. TitanFuzz and Fuzz4All generate inputs for general software, and AgentFuzz drives agents to reach taint-style sinks.
- Baselines and data: Experimental baselines are ToolFuzz, VIPER-MCP, Cisco MCP Scanner, CodeQL sec-extended, and Claude-Sonnet-5 (§7.3). Data comes from a fixed commit of MCPCorpus (Lin et al., 2025) (§7.1). The authors state that ToFu builds on Atheris and adds an oracle for "normal returns that still violate documented properties."
The authors' positioning is: rather than asking which tools match known vulnerabilities, derive security properties from each parameter's documented semantics and challenge those properties (§5).
How does the paper address this problem?
ToFu uses tool metadata to select CWE sanitizers and generates schema-valid harnesses and semantic oracles.
ToFu turns metadata exposed to LLMs into executable security tests (Figure 1): parses descriptions and schemas, maps sanitizers, generates schema-valid seeds and harnesses, then uses Atheris for coverage-guided fuzzing from seeds. LLM only interprets natural language for mapping and initial seeds, not as a security oracle. Authors map four challenges to attribute inference, per-tool specialization, oracle under partial visibility, and corpus scalability (§5–§6).
Metadata and Sanitizers
- Metadata Parser normalizes different MCP declarations into an aligned JSON Schema representation, preserving original schema for LLM and input decoding, and recursively enters nested objects and arrays; enums are taken from their listed values (§6.1).
- A sanitizer is written as S=⟨ A,G,O,I⟩: A is applicability condition, G is adversarial input class, O is expected safety property, I is observations needed for adjudication (§6.2).
- Two implementation types: Introspector with tracer, recording calls reaching sinks in-process; Outcome Sanitizer flags adversarial inputs, reporting bugs only when Outcome Oracle agrees. Corpus totals 74 (Appendix C). Authors state that a sanitizer accepts a CWE only when observable properties suffice to establish the defining conditions; CWE is not the oracle itself.
- Introspection uses 21 tracers hooking Python APIs like open, subprocess, socket (Table 7). Filesystem checks record raw paths at API boundaries, then normalize access paths against authorized roots (including relative traversal, redundant separators, and symlinks) to determine if they escape the workspace. These tracers are only for Python targets.
Result Adjudication and Per-Tool Specialization
- Main inconsistency in result checking is V(x)∧¬Reject(T(x),E): sanitizer considers input x invalid or malicious, and target does not reject it (§6.2.2). E includes side effects when available. Authors state most common is malicious input accepted without error or safe fallback.
- Contributions list detection methods as runtime introspection and black-box differential checking; main text's second mode is outcome sanitization. Nondeterminism is handled via semantic invariants like error types and schema rejections, not byte-level output. Tools without side effects check output validity and execution health; when results are ambiguous, return status is compared against introspection traces.
- Each selected Outcome Sanitizer has on_trigger written by LLM, applied only on error-free returns. raise_exception means must reject; allow_success_with_fallback allows only listed fallback values; allow_success_always means the tool should accept such inputs, thus not reported. Introspector does not use this rule because observed events themselves are violations. Deployment values like workspace root come from target configuration, not metadata.
- Selection does not gate all checks: 11 run on every execution, 35 run when evidence appears, 27 run only when selected by LLM, 1 registered but not called (Appendix C). Out-of-corpus names are discarded; missed selection may miss bugs; §7.7 measures with "all enabled".
Harness, Seeds, and Loop
- Harness mutates structured parameters, avoiding arbitrary byte mutations being rejected by schema before reaching implementation (§6.4). Selected parameters take values from corresponding adversarial input classes; others are filled with schema-valid values.
- Seeds are adapted by LLM from seed bank into schema per selected sanitizer; when no matching class, uses entire bank. Can also call eight file-builders covering PDF, DOCX, XLSX, PPTX, ZIP, XML, HTML, JSON. If retries still fail, deterministic mapper fills schema from seed bank. Appendix H states selection at most three times, seed generation at most four. In evaluation, these two steps use gpt-4.1, temperature 0, fixed seed; fuzz loop no longer calls LLM (§7.2).
- Inputs increasing coverage are kept to guide mutation; whether contract is violated is judged by oracle. Crashes and sanitizer outputs mark inputs as potential failures or policy violations. Reports include triggering call, affected parameters, expected property, and observed behavior (§6.5).
- New weakness classes are self-contained entries, not changing mapping and fuzz phases. ToFu does not synthesize sanitizers at runtime. Authors state reflected-output (CWE-79/116) was added later during development (§6.3).
What experiments did the paper conduct?
On 273 MCP servers, manual review yields 253 reproducible bugs across 343 tools on 118 servers.
Experimental Setup
- Environment: Ubuntu 24.04, 12 cores, 32 GB; Python 3.13, Node.js 22. Targets are pinned commits. Each fuzz runs in bubblewrap with a read-only root filesystem and private /tmp (§7.2).
- Data: Population from pinned commits of MCPCorpus. Table 2: 13,875 records filtered to 2,222 repositories with at least 10 stars, not archived, non-client, and deduplicated; then limited to Python/JS to 1,847; after extraction, 1,404 expose at least one tool (597 Python, 807 JS), totaling 24,194 tools. 417 can be built correctly and execute at least one call; the reachable denominator with at least one successful return is 273, containing 3,405 extracted tools. The authors state that only a subset of tools were successfully executed in the analysis, still using 3,405 as the extraction scale (§7.1).
- Analyzers: ToFu, plus one baseline from each of five categories: ToolFuzz, VIPER-MCP, Cisco MCP Scanner (YARA, LLM judge, behavioral analysis), CodeQL sec-extended, Claude-Sonnet-5. All run on these 273 servers (§7.3, Appendix F).
- Models and Budget: ToFu's two LLM steps use gpt-4.1, temperature 0, fixed seed. Cisco's two LLM roles and ToolFuzz use gpt-4.1-mini. CodeQL 2.27.0. Main experiment: 60 seconds per tool; 34 servers additionally run 24 hours each. ToFu uses three repetitions to measure residual variance; other results are single runs (§7.2).
- Adjudication: Candidates undergo manual review: reproduction, code reading, understanding server intent, avoiding classifying tools that execute caller code as documented as vulnerabilities. After deduplication, counted as reproducible bugs and classified by CWE (§7.5, Table 3).
- LLM Usage: Per GPT-4.1 tokenizer, ToFu per tool: 2.1 calls, 4.7k input, 0.45k output tokens, totaling 3,853 calls, 8.5M input, 0.81M output (Table 5).
Main Results
Abstract writes findings as verified bugs on 343 tools across 118 servers, corresponding to CWE classes. Main text and Table 3 count 253 reproducible bugs after deduplication, noting that one bug can affect multiple tools. 508 candidates come from 147 servers (Table 2); review removes 103 "non-vulnerabilities" and 152 duplicates.
Weakness Class Reproducible Bugs reflected output (CWE-116/79) 115 path traversal (CWE-22) 64 log injection (CWE-117) 58 SSRF (CWE-918) 7 data exfiltration (CWE-201) 5 OS command injection (CWE-78) 3 leftover temp file (CWE-459) 1 - No crash dependence: Authors state these failures do not require crashes. Of 508 candidates, 326 directly observe dangerous operations or unescaped adversarial values in output; 182 violate semantic constraints but the tool reports success; to crash or schema tests, both look like normal calls (§7.5).
- Authors' explanation: Authors attribute this to trust failure at the LLM–tool boundary: documented semantics are not necessarily enforced by implementation, untrusted model-generated inputs are often treated as safe, and validation responsibility is left to the LLM or orchestration layer (§7.5).
- Review criteria: Review checks against code intent, not classifying tools whose documented purpose is to execute scripts as vulnerabilities (§7.5).
Comparison with Five Baselines
- Server-level flags: Per Table 4, ToFu flags 118 of 273 servers. ToolFuzz 92 (shares 56 with ToFu), VIPER taint stage 48, agent confirmation 11 (shares 36, of which agent 7), Cisco 46 (shares 23; 29 only by YARA), CodeQL 95 (shares 56), Sonnet-5 119 (shares 71). Any baseline totals 198, sharing 110 with ToFu. 8 servers have findings only by ToFu (§7.3).
- Not measuring the same thing: Authors state no single leaderboard. ToolFuzz reports runtime failures on 200 tools, 77 servers, and correctness failures on 114 tools, 52 servers, totaling 237 tools, 92 servers; the paper relays ToolFuzz authors' false-discovery rate for correctness failures as 46%. VIPER's agent confirms 11 exploits on 11 servers (§7.3).
- Counterexamples and reachability: On four tools whose documented purpose is to execute caller code, VIPER has confirmed exploits while ToFu does not report. On s/applescript-mcp, ToFu returns successfully over 2,000 times with no alerts; authors state the chosen sanitizers do not treat parameters intended for code as adversarial inputs. On s/google_workspace_mcp and s/mcp-sitecore-server, successful calls are few; authors call this a reachability gap, not an oracle blind spot (§7.3).
Budget, Coverage, and Ablations
- 60 seconds vs deep budget: 60 seconds finds 231 reviewed bugs; the remaining 22 appear only in deep budget, between 111 seconds and 70 minutes. Figure 3 shows 34 servers, 24 hours each. Authors state 74% of candidates appear within 1 minute, 80% of reproducible bugs first appear within 60 seconds; 73% of tools reach 90% of their final coverage in the first minute, 56% reach final coverage. Coverage is not compared across tools or languages (§7.6).
- Figure 2 annotations: Eight tools' 60-second and final coverage include 1292/1383, 400/664, 187/495, 225/318, 158/248, and 56/56, 38/38, 32/32. Authors state five of these still increase after the first minute, and stop increasing after about an hour. Authors state that among servers flagged by baselines but not by ToFu, about 63% fail to start, hang on startup, or reject all inputs at schema, credential, or format checks. Median throughput is 43–46 per second (§7.6).
- Component ablations are unreviewed candidates: Three full runs are 436, 428, 427; paper gives mean 430±5; those appearing in all three are 342, pairwise Jaccard 0.75–0.81. Relative to that mean, no-LLM-seeds 396 (−8%), no-LLM-selection 311 (−28%), no-LLM 293 (−32%), no-seeds 244 (−43%) (Table 8). Authors state that removing LLM selection nearly eliminates path traversal, SSRF, and command injection. no-seeds path traversal is 1, SSRF remains 42. First full run's 436 is lower than §7.5's 508; authors state 508 combines multiple campaigns (§7.7).
Other Ablations and Analyses
- Table 9 first full run: ToFu condition 436 (Python 169, JS 267); tracer-only 87 (86/1, the 1 in JS is credential pattern check on output); no-tracer 373 (107/266); oracle-ignoring sanitizer-only 450 (132/318).
- Authors state that removing the tracer loses bugs almost exclusively in Python; removing "must return successfully" replaces about one-eighth of bugs with another (§7.7).
- all-sanitizers: of 960 reports, authors mark 47 as true (4.9%); on tools not flagged by ToFu, 13 of 539 are true (2.4%), spread across 5 servers (Table 10). These 13 are 5 SSRF on the same WordPress server, plus 7 log injection and 1 reflected output. Authors state that on this JS server, the LLM selected an SSRF tracer that exists only in-process Python.
- Authors state that on tools flagged only by all-sanitizers, over 90% are false; throughput 43.5/s vs 43.1 (§7.7).
- LLM selects on average 3 sanitizers per tool, max 27; 193 executed tools select none. Authors state average about 11 seeds; fallback used for 6 tools; 119 tools call file builder. 35/74 sanitizers and 11/21 tracers trigger on this dataset (§7.4, Appendix D).
- Four servers affect the evaluation host during fuzzing: deleting files outside workspace, following paths outside vault, terminating terminals not owned, spawning processes without limits. Authors state about one-fifth of servers found only by static baselines involve permissive CORS, incorrect sanitization regexes, or filesystem races, better suited to static analysis (§7.5).
What are some points that can be further explored?
The authors leave multi-agent paths, third-party component coverage, and stateful tool sequences as future work.
Limitations and Future Directions Noted by the Authors
- Multi-agent: Currently targets tool calls issued through orchestration frameworks. One agent's tool result may become another agent's argument. The authors leave multi-agent support for future work (§8).
- Third-party components: Many tools are thin wrappers around external libraries, services, or applications; collecting only coverage of the tool implementation does not show the extent to which the underlying components are exercised. The authors leave component-specific instrumentation for future work (§8).
- Stateful calls: Inputs are currently generated per single interface; bugs that depend on state built by previous calls may require a sequence of valid calls. The authors state that determining useful call sequences over large tool sets remains an open problem, and leave stateful tool fuzzing for future work (§8).
- Probe precision: Appendix E states that the static sink probes have no measured precision or recall, and that establishing precision requires labeled samples per family, which is called future work.
- Probe method: Static matching cannot see dynamically constructed calls; repository granularity also records code that no registered tool can reach as having a sink (Appendix E).
Experimental Coverage
- The evaluation targets are 273 MCP servers obtained from the MCPCorpus funnel with at least one successful call, with 3405 tools extracted, in Python and JavaScript (§7.1, Table 2).
- The comparison analyzers are ToolFuzz, VIPER-MCP, Cisco MCP Scanner, CodeQL sec-extended, and Claude-Sonnet-5, all run on these 273 servers (§7.3, Table 4).
- The main budget is 60 seconds per tool; 34 servers additionally have 24 hours per server. The full configuration is repeated 3 times, and each of the other ablation arms once (§7.2, §7.7).
- 508 candidates were manually reviewed by the authors into 253 reproducible bugs (Table 3). The paper does not report the number of reviewers or agreement.
- 21 introspection tracers run inside the Python target process; JavaScript relies on the outcome oracle (§6.2, Table 9). The authors write in §7.5 that ToFu does not capture properties without observable runtime events. Repeat-After-Me is reproduced on six orchestration layers, and Appendix B gives the record for LangGraph 1.2.0 among them (§1).
Summarize the main content of the paper
ToFu turns tool metadata into semantic checks, and on 118 MCP servers, manual review confirmed 253 bugs.
ToFu is a semantic fuzzing framework for LLM tools, used to check whether parameters dispatched by the orchestration layer are implemented as documented.
- Problem: Tool calls are structured model outputs interpreted by the orchestration layer as executable requests. If an attacker can influence prompts, retrieved content, or other tool outputs, schema-valid parameters can still be adversarial. Crash-class oracles cannot see executions that return successfully but exceed authority.
- Approach: Map parameter descriptions to 74 CWE-oriented sanitizers. gpt-4.1 (temperature 0) is used only for selection and initial seeds, not as a judge. Harnesses remain schema-valid, and Atheris performs edge-coverage mutation. When in-process visibility is available, 21 Python tracers are used; otherwise, check whether flagged inputs are rejected.
- Results: On 273 executable MCP servers and 3405 extracted tools, 508 candidates were manually reviewed to yield 253 reproducible bugs across 343 tools in 118 servers. Table 3 shows reflected output 115, path traversal 64, log injection 58, plus SSRF 7, data exfiltration 5, command injection 3, and leftover temporary files 1. A 60-second budget found 231.
- Comparison: The flags from five baselines do not fully overlap with ToFu; 8 servers were flagged only by ToFu. The authors do not set a single leaderboard and state that the nature of measurements differs across parties. Removing LLM selection nearly eliminates path traversal, SSRF, and command injection from unreviewed candidates; enabling all sanitizers introduces 13 real bugs not reported by ToFu.
- Authors' conclusion: Hardening only model behavior and orchestration is insufficient; the software that ultimately executes actions often does not enforce the security properties advertised by the interface. The authors argue that tool metadata can serve as testable security specifications rather than promises left to the LLM to fulfill.