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

sCompile:智能合约的关键路线识别与分析

sCompile: Critical Path Identification and Analysis for Smart Contracts

Jialiang Chang, Bo Gao, Hao Xiao, Jun Sun, Yan Cai, Zijiang Yang

摘要:

以太坊智能合约是建立在区块链技术之上的一项创新,它提供了一个以匿名、分布式和可信的方式自动执行合约的平台。与普通程序不同,智能合约一旦部署就无法轻松修补,这一事实放大了这个问题。重要的是要检查智能合约是否存在潜在的漏洞。在这项工作中,我们提出了一种替代方法来自动识别智能合约中的关键程序路径(具有多个函数调用,包括合约间函数调用),根据其关键性对路径进行排名,如果它们不可行则丢弃它们,或者以其他方式向它们提供用户友好的警告以供用户检查。我们确定的路径,涉及货币交易的关键路线,并优先考虑那些可能违反重要属性。对于可伸缩性,符号执行技术仅应用于排名靠前的关键路线。我们的方法已经在一个名为sCompile的工具中实现,该工具已应用于36,099个智能合约。实验结果表明,sCompile是有效的,即,平均5秒完成一个智能合约。此外,我们发现,许多已知的漏洞可以被捕获,如果用户检查少至10 sCompile生成的程序路径。最后,sCompile在用户检查之前发现了224个未知漏洞,误报率为15.4%。

英文摘要:

Ethereum smart contracts are an innovation built on top of the blockchain technology, which provides a platform for automatically executing contracts in an anonymous, distributed, and trusted way. The problem is magnified by the fact that smart contracts, unlike ordinary programs, cannot be patched easily once deployed. It is important for smart contracts to be checked against potential vulnerabilities. In this work, we propose an alternative approach to automatically identify critical program paths (with multiple function calls including inter-contract function calls) in a smart contract, rank the paths according to their criticalness, discard them if they are infeasible or otherwise present them with user friendly warnings for user inspection. We identify paths which involve monetary transaction as critical paths, and prioritize those which potentially violate important properties. For scalability, symbolic execution techniques are only applied to top ranked critical paths. Our approach has been implemented in a tool called sCompile, which has been applied to 36,099 smart contracts. The experiment results show that sCompile is efficient, i.e., 5 seconds on average for one smart contract. Furthermore, we show that many known vulnerabilities can be captured if user inspects as few as 10 program paths generated by sCompile. Lastly, sCompile discovered 224 unknown vulnerabilities with a false positive rate of 15.4% before user inspection.

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

↑