arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2212.12110cs.SE
收藏

对抗智能合约中的抢先交易:攻击挖掘、基准构建与漏洞检测器评估

Combatting Front-Running in Smart Contracts: Attack Mining, Benchmark Construction and Vulnerability Detector Evaluation

Wuqi Zhang, Lili Wei, Shing-Chi Cheung, Yepang Liu, Shuqing Li, Lu Liu, Michael R. Lyu

AI总结:

针对区块链智能合约抢先交易攻击检测缺乏真实基准的问题,本研究构建了含513起真实攻击、覆盖235个合约的漏洞基准,提出自动化攻击收集与漏洞定位方法,并评估发现现有7种先进检测技术召回率最高仅6.04%,指出四类共性局限。

摘要:

抢先交易攻击一直是区块链领域的主要隐患。攻击者通过在即将到来的受害者交易之前插入额外交易来发起抢先攻击,操纵受害者交易的执行过程并牟利。近期研究表明,抢先交易攻击在以太坊区块链上十分普遍,已造成数百万美元的损失。存在漏洞的智能合约(即由交易调用的区块链程序)是导致抢先交易攻击的主要原因。尽管已有研究提出了多种抢先交易漏洞检测技术,但它们在真实漏洞合约上的性能仍不明确,目前尚无基于真实攻击的大规模基准来评估这些技术的检测能力。这促使我们构建了一个包含513起真实攻击的基准,其中标注了235个不同智能合约中的漏洞代码。我们提出了自动化技术,可高效大规模收集真实攻击并定位对应的漏洞代码。实验表明,我们的方法十分有效,与现有技术相比,在发现真实攻击方面实现了更高的召回率,在定位漏洞方面实现了更高的准确率。我们在该基准上对7种最先进的漏洞检测技术进行了评估,结果显示它们在检测抢先交易漏洞方面存在不足,最高召回率仅为6.04%。进一步分析发现了现有技术的四个常见局限:缺乏跨合约分析支持、密码学运算的约束求解效率低下、漏洞模式不合理,以及缺乏代币支持。

英文摘要:

Front-running attacks have been a major concern on the blockchain. Attackers launch front-running attacks by inserting additional transactions before upcoming victim transactions to manipulate victim transaction executions and make profits. Recent studies have shown that front-running attacks are prevalent on the Ethereum blockchain and have caused millions of US dollars loss. Vulnerable smart contracts, blockchain programs invoked by transactions, are held responsible for front-running attacks. Although techniques to detect front-running vulnerabilities have been proposed, their performance on real-world vulnerable contracts is unclear. There is no large-scale benchmark based on real attacks to evaluate their capabilities. This motivates us to build a benchmark consisting of 513 real-world attacks with vulnerable code labeled in 235 distinct smart contracts. We propose automated techniques to effectively collect real-world attacks and localize the corresponding vulnerable code at scale. Our experiments show that our approaches are effective, achieving higher recall in finding real attacks and higher precision in pinpointing vulnerabilities compared to the existing techniques. The evaluation of seven state-of-the-art vulnerability detection techniques on the benchmark reveals their inadequacy in detecting front-running vulnerabilities, with a low recall of at most 6.04%. Our further analysis identifies four common limitations in existing techniques: lack of support for inter-contract analysis, inefficient constraint solving for cryptographic operations, improper vulnerability patterns, and lack of token support.

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

↑