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.
翻译:在区块链上,前置交易攻击一直是一个主要问题。攻击者通过在即将到来的受害者交易之前插入附加交易来操纵受害者交易的执行并获利。最近的研究表明,前置交易攻击在以太坊区块链上普遍存在,并造成了数百万美元的损失。弱点智能合约是前置交易攻击的责任方。尽管已经提出了检测前置交易漏洞的技术,但它们在真实漏洞合约中的表现不清楚。不存在基于真实攻击的大规模基准来评估它们的能力。这促使我们建立一个基准,由 513 个真实的攻击和 235 个不同的智能合约中标记了易受攻击代码的标签组成。我们提出了自动化技术,以有效地收集实际攻击并在规模上定位相应的易受攻击代码。我们的实验表明,我们的方法是有效的,与现有技术相比,在找到真实攻击和准确定位漏洞方面具有更高的召回率和更高的精度。对基准测试中七种最先进的漏洞检测技术的评估揭示了它们无法检测前置交易漏洞,其召回率最多只有 6.04%。我们的进一步分析确定了现有技术的四个常见限制: 不支持合同间的分析,密码操作的低效限制求解,不当的漏洞模式以及缺乏代币支持。