arXiv:2602.01317cs.CRcs.AI2026-02被引 2

用AI自动复盘区块链攻击,快速生成可重现的漏洞证明。

TxRay: Agentic Postmortem of Live Blockchain Attacks

  • 通过大模型调用工具,从少量交易信息还原攻击全过程。
  • 92%的攻击事件能完整复现,98%的漏洞证明不硬编码攻击者地址。
  • 适合安全团队、开发者快速响应和验证链上攻击。

去中心化金融(DeFi)将区块链变为金融基础设施,但其开放性也使代码控制的资金池易受攻击。五年间,DeFi生态因已知漏洞损失超157.5亿美元。许多攻击源于任何人可触发的权限无关机会(Anyone-Can-Take, ACT),仅需公开状态和标准接口即可发动。尽管链上数据透明,事后分析仍依赖人工且耗时:通常仅凭单个交易哈希,需手动恢复相关交易、合约代码与状态依赖。本文提出TxRay,一个基于大语言模型(LLM)的智能体式事后分析系统,能从一个或多个种子交易出发,自动重构实时ACT攻击的全生命周期,推导出有证据支持的根本原因,并生成可独立运行的可重现漏洞证明(PoC)。TxRay通过编码特定语义断言作为可执行断言进行自我校验。为评估PoC质量,我们开发了独立的智能体式评估器PoCEvaluator。在DeFiHackLabs的114个案例中,TxRay对105个事件达成专家一致的根本原因判定,并实现92.11%的端到端复现率。经PoCEvaluator验证,98.1%的PoC未硬编码攻击者地址,较DeFiHackLabs提升22.9个百分点。在实际部署中,平均40分钟内输出根因,59分钟内生成可运行的漏洞证明。其经断言验证的漏洞证明可实现攻击模仿,覆盖度分别比STING和APE提高15.6%和65.5%。

原文摘要 · Abstract (English)

Decentralized Finance (DeFi) has turned blockchains into financial infrastructure, allowing anyone to trade, lend, and build protocols without intermediaries, but this openness exposes pools of value controlled by code. Within five years, the DeFi ecosystem has lost over 15.75B USD to reported exploits. Many exploits arise from permissionless opportunities that any participant can trigger using only public state and standard interfaces, which we call Anyone-Can-Take (ACT) opportunities. Despite on-chain transparency, postmortem analysis remains slow and manual: investigations start from limited evidence, sometimes only a single transaction hash, and must reconstruct the exploit lifecycle by recovering related transactions, contract code, and state dependencies. We present TxRay, a Large Language Model (LLM) agentic postmortem system that uses tool calls to reconstruct live ACT attacks from limited evidence. Starting from one or more seed transactions, TxRay recovers the exploit lifecycle, derives an evidence-backed root cause, and generates a runnable, self-contained Proof of Concept (PoC) that deterministically reproduces the incident. TxRay self-checks postmortems by encoding incident-specific semantic oracles as executable assertions. To evaluate PoC correctness and quality, we develop PoCEvaluator, an independent agentic execution-and-review evaluator. On 114 incidents from DeFiHackLabs, TxRay produces an expert-aligned root cause and an executable PoC for 105 incidents, achieving 92.11% end-to-end reproduction. Under PoCEvaluator, 98.1% of TxRay PoCs avoid hard-coding attacker addresses, a +22.9pp lift over DeFiHackLabs. In a live deployment, TxRay delivers validated root causes in 40 minutes and PoCs in 59 minutes at median latency. TxRay's oracle-validated PoCs enable attack imitation, improving coverage by 15.6% and 65.5% over STING and APE.

区块链安全AI复盘漏洞挖掘智能体系统

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。