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

SmartOracle:通过细粒度不变量检测生成智能合约预言机

SmartOracle: Generating Smart Contract Oracle via Fine-Grained Invariant Detection

Jianzhong Su, Jiachi Chen, Zhiyuan Fang, Xingwei Lin, Yutian Tang, Zibin Zheng

AI总结:

本文提出 SmartOracle,从历史交易中自动挖掘多层细粒度不变量作为漏洞检测预言机,并在 ERC20 不变量和真实漏洞合约交易上验证了高精确率与有效性。

摘要:

随着去中心化应用(DApps)的激增,智能合约复杂性和使用量的增加提高了其遭遇安全事件和财务损失的可能性。尽管已经开发了各种漏洞检测工具来缓解这些问题,但它们在检测漏洞时往往性能不佳,原因是它们要么依赖可能不足以支持漏洞检测的简单通用预言机,要么需要用户指定预言机,而创建这类预言机非常耗费人力。本文提出 SmartOracle,这是一种动态不变量检测器,可自动生成细粒度不变量,作为面向具体应用的漏洞检测预言机。SmartOracle 从历史交易出发,利用基于模式的检测和高级推理构建全面属性,并挖掘多层可能不变量,以适应复杂的合约功能。随后,SmartOracle 通过在新交易中搜寻被违反的不变量来识别智能合约漏洞。在不变量检测领域,SmartOracle 检测到的 ERC20 不变量比现有动态不变量检测多 50%,并达到 96% 的精确率。此外,我们构建了一个包含来自真实安全事件的漏洞合约数据集。SmartOracle 成功检测出 466 笔异常交易,涉及 31 个漏洞合约,可接受的精确率为 96%。实验结果证明了其在检测智能合约漏洞方面的有效性,尤其是与复杂合约功能相关的漏洞。

英文摘要:

As decentralized applications (DApps) proliferate, the increased complexity and usage of smart contracts have heightened their susceptibility to security incidents and financial losses. Although various vulnerability detection tools have been developed to mitigate these issues, they often suffer poor performance in detecting vulnerabilities, as they either rely on simplistic and general-purpose oracles that may be inadequate for vulnerability detection, or require user-specified oracles, which are labor-intensive to create. In this paper, we introduce SmartOracle, a dynamic invariant detector that automatically generates fine-grained invariants as application-specific oracles for vulnerability detection. From historical transactions, SmartOracle uses pattern-based detection and advanced inference to construct comprehensive properties, and mines multi-layer likely invariants to accommodate the complicated contract functionalities. After that, SmartOracle identifies smart contract vulnerabilities by hunting the violated invariants in new transactions. In the field of invariant detection, SmartOracle detects 50% more ERC20 invariants than existing dynamic invariant detection and achieves 96% precision rate. Furthermore, we build a dataset that contains vulnerable contracts from real-world security incidents. SmartOracle successfully detects 466 abnormal transactions with an acceptable precision rate 96%, involving 31 vulnerable contracts. The experimental results demonstrate its effectiveness in detecting smart contract vulnerabilities, especially those related to complicated contract functionalities.

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

↑