论文标题
在智能合约中打击前跑:攻击采矿,基准构造和脆弱性检测器评估
Combatting Front-Running in Smart Contracts: Attack Mining, Benchmark Construction and Vulnerability Detector Evaluation
论文作者
论文摘要
前进攻击一直是区块链的主要问题。攻击者通过在即将进行的受害者交易之前插入其他交易来发动前进攻击,以操纵受害者交易并获得利润。最近的研究表明,前进攻击在以太坊区块链上很普遍,并导致了数百万美元的损失。易受伤害的智能合约,由交易所援引的区块链计划负责领先的攻击。尽管已经提出了检测前进漏洞的技术,但它们在现实世界中的脆弱合同的表现尚不清楚。基于实际攻击来评估其能力,没有大规模的基准。这激发了我们建立一个由513次现实世界攻击组成的基准,并用235个不同的智能合约标记的脆弱代码。我们提出了自动化技术,以有效地收集现实攻击并在大规模上定位相应的脆弱代码。我们的实验表明,我们的方法是有效的,与现有技术相比,在发现真正的攻击和更高的精确度方面,可以实现更高的回忆。对基准上的七种最先进的漏洞检测技术的评估表明,它们在检测前运行脆弱性方面的不足,最多低于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.