Skip to main content
QUICK REVIEW

[论文解读] sCompile: Critical Path Identification and Analysis for Smart Contracts

Jialiang Chang, Bo Gao|arXiv (Cornell University)|Aug 2, 2018
Security and Verification in Computing参考文献 14被引用 16
一句话总结

sCompile 是一种静态分析工具,通过构建控制流图和符号执行,识别并排序以太坊智能合约中的关键执行路径,特别是涉及资金交易的路径。该工具通过优先处理高风险路径,减少了手动检查的工作量,平均分析时间仅为5秒,检测到224个未知漏洞,误报率为15.4%(用户审查前)。

ABSTRACT

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.

研究动机与目标

  • 通过识别和优先处理关键执行路径,减少手动检查智能合约漏洞所需的工作量。
  • 通过仅对排名靠前的路径应用符号执行,提升智能合约分析的可扩展性。
  • 通过分析涉及资金交易和已知安全属性的路径,检测此前未知的漏洞。
  • 为关键路径提供可操作且用户友好的警告,提升开发人员对高风险行为的理解。
  • 通过结合静态分析与针对性符号执行,在精度与效率之间取得平衡。

提出的方法

  • 构建包含跨合约函数调用的控制流图(CFG),以建模所有可能的执行路径。
  • 基于是否包含资金交易来识别关键路径,并优先处理可能违反预定义安全属性的路径。
  • 使用可配置公式为每条路径分配关键性评分,综合考虑安全属性违反的严重程度和路径长度。
  • 仅对排名靠前的路径应用符号执行,以验证可行性并检测实际漏洞。
  • 向用户展示可行且关键性高的路径,并提供清晰的警告以供手动检查。
  • 使用静态分析提前剪枝不可行或低优先级的路径,从而提升可扩展性。

实验结果

研究问题

  • RQ1混合使用静态分析与符号执行的方法是否能有效优先处理智能合约路径,从而减少手动检查的工作量?
  • RQ2基于资金交易参与情况和安全属性违反潜力的关键路径排序,在检测真实漏洞方面有多高效?
  • RQ3将符号执行限制在排名靠前的路径范围内,是否会导致遗漏关键漏洞?
  • RQ4在检测未知漏洞时,分析效率与误报率之间的权衡如何?
  • RQ5当开发者获得 sCompile 的路径分析提示时,其识别漏洞的表现相较于无提示时如何?

主要发现

  • sCompile 分析了 36,099 份智能合约,平均每份合约的分析时间为 5 秒,展现出极高的效率。
  • 该工具检测到 224 个此前未知的漏洞,表明其具备强大的漏洞发现能力。
  • 用户审查前的误报率为 15.4%,在实际应用中被认为是可以接受的。
  • 平均仅检查 10 条关键路径就足以发现已知漏洞,凸显了其路径优先处理的有效性。
  • 用户研究显示,sCompile 显著提升了漏洞检测的速度与准确性,尤其在提供路径提示时效果更明显。
  • 用户对工具的实用性评价较高(平均得分为 5/7),证实了其在智能合约安全分析中的实际价值。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。