arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2605.30998cs.CRcs.CE
收藏

AI经济中的搭便车:x402支付系统中逻辑缺陷的解密

Free-Riding the Agentic Web: A Systematic Security Analysis of x402 Payments

City University of Hong Kong(香港城市大学);Zhejiang University(浙江大学);The Chinese University of Hong Kong(香港中文大学)

Shengchen Ling, Yihang Huang, Yuefeng Du, Yuan Chen, Yajin Zhou, Lei Wu, Cong Wang

AI总结:

本文首次对x402协议生态进行安全分析,通过形式化五个安全不变量,揭示了同步HTTP请求与异步区块链最终性之间的状态同步漏洞,并提出了请求绑定签名和悲观状态锁定等缓解措施。

摘要:

代理经济需要程序化金融轨道,将x402协议定位为机器对机器支付的事实标准。然而,同步HTTP请求与异步区块链最终性的桥接带来了深刻的状态同步挑战。在这项工作中,我们首次对x402生态系统进行了全面的安全分析。通过形式化五个安全不变量,我们揭示了当前实现未能强制执行事务原子性和密码学上下文绑定,导致了系统性漏洞。我们识别了签名设计中的语义差距,使得跨资源替换成为可能,即支付证明被移植到其他未授权上下文中。此外,我们暴露了一个时间差距,其中并发竞争条件允许概率性服务重复。在AI推理领域,我们展示了动态定价模型如何容易受到允许透支和基础设施速率限制的影响。我们针对官方SDK和实际部署验证了这些漏洞。具体来说,我们展示了攻击者可以利用动态授权方案中的同步差距,迫使商家补贴计算成本,在生产中间件上实现高达100%的资源泄漏率。最后,我们提出了架构缓解措施,倡导请求绑定签名和悲观状态锁定,以保护自主代理的金融轨道。所有发现的问题已向Coinbase和ThirdWeb披露。

英文摘要:

The x402 protocol has crossed from prototype to infrastructure for the agentic web, driving 130 million all-time transactions and embedded in Google Cloud, Cloudflare, and Stripe. Yet bridging synchronous HTTP requests with asynchronous blockchain finality creates state-synchronization challenges, and x402's security has so far been examined only in piecemeal vendor disclosures. It is moreover not one artefact but a stack of an HTTP semantic, per-chain schemes, and a long tail of SDK and deployment choices whose required guarantees prior work has not established. We perform a systematic security analysis organized around five invariants grounded in specifications, literature, and vendor expectations, resolving every violation to the responsible layer. We identify four flaw classes: cross-resource substitution, duplicate-settlement race (independently corroborated by subsequent third-party reports), allowance overdraft, and denial of settlement. Against official SDKs and a production deployment, these reach resource-leakage ratios up to 100%. For pay-per-token scheme we prove a structural limit: no output-only pricing can be both fair to honest users and bounded against inflation of the hidden "thinking" tokens, the price of fairness being a $\sqrt{1+Θ}$ manipulation gap. We propose per-flaw mitigations and a defense triple with provable guarantees, cutting per-call reasoning cost by 47% and inverting attacker leverage from 8.7$\times$ to 0.9$\times$ at only 2.8% overhead. All findings have been disclosed.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑