Your Agent Is Mine: Measuring Malicious Intermediary Attacks on the LLM Supply Chain

Agent Tool Learning Agent Eval Benchmarks AI Safety / AI Ethics PIAAP MBDSF
大型语言模型(LLM)智能体日益依赖第三方API路由服务,将工具调用请求分发至多个上游服务商。这些路由器作为应用层代理运行,可全程以明文形式访问所有传输中的JSON载荷;然而,目前尚无任何上游模型服务商在客户端与自身之间强制实施密码学层面的完整性保护机制。本文首次对该攻击面展开系统性研究。我们构建了一个针对恶意LLM API路由器的威胁模型,并定义了两类核心攻击:载荷注入(AC-1)与密钥窃取(AC-2);此外还提出两种自适应规避变体:面向依赖关系的定向注入(AC-1.a)与条件式交付(AC-1.b)。我们在淘宝、闲鱼及Shopify托管店铺中采购了28个付费路由器,在公开社区中收集了400个免费路由器,结果发现:其中1个付费路由器和8个免费路由器正在主动注入恶意代码;2个路由器部署了自适应规避触发机制;17个路由器接触到了研究人员持有的AWS金丝雀凭证;另有1个路由器已成功从研究人员私钥控制的钱包中盗取以太币(ETH)。两项投毒实验进一步表明,表面上看似无害的路由器同样可能被卷入同一攻击面:一个意外泄露的OpenAI密钥被用于生成1亿个GPT-5.4 Token,并触发了超过七次Codex会话;而配置较弱的诱饵路由器则导致20亿个计费Token被消耗、在440次Codex会话中泄露99组凭据,且已有401次会话进入自主运行的YOLO(You Only Look Once,此处引申为“不加验证、直接执行”)模式。为此,我们构建了研究型代理工具Mine,该工具可在四个主流公开智能体框架上完整复现全部四类攻击;并基于此评估了三种可实际部署的客户端防护措施:失效即关闭(fail-closed)策略门控机制、响应侧异常检测筛查机制,以及仅追加(append-only)式透明日志记录机制。
Large language model (LLM) agents increasingly rely on third-party API routers to dispatch tool-calling requests across multiple upstream providers. These routers operate as application-layer proxies with full plaintext access to every in-flight JSON payload, yet no provider enforces cryptographic integrity between client and upstream model. We present the first systematic study of this attack surface. We formalize a threat model for malicious LLM API routers and define two core attack classes, payload injection (AC-1) and secret exfiltration (AC-2), together with two adaptive evasion variants: dependency-targeted injection (AC-1.a) and conditional delivery (AC-1.b). Across 28 paid routers purchased from Taobao, Xianyu, and Shopify-hosted storefronts and 400 free routers collected from public communities, we find 1 paid and 8 free routers actively injecting malicious code, 2 deploying adaptive evasion triggers, 17 touching researcher-owned AWS canary credentials, and 1 draining ETH from a researcher-owned private key. Two poisoning studies further show that ostensibly benign routers can be pulled into the same attack surface: a leaked OpenAI key generates 100M GPT-5.4 tokens and more than seven Codex sessions, while weakly configured decoys yield 2B billed tokens, 99 credentials across 440 Codex sessions, and 401 sessions already running in autonomous YOLO mode. We build Mine, a research proxy that implements all four attack classes against four public agent frameworks, and use it to evaluate three deployable client-side defenses: a fail-closed policy gate, response-side anomaly screening, and append-only transparency logging.
许愿