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

Vulseye:通过有向状态灰盒模糊测试检测智能合约漏洞

Vulseye: Detect Smart Contract Vulnerabilities via Stateful Directed Graybox Fuzzing

Ruichao Liang, Jing Chen, Cong Wu, Kun He, Yueming Wu, Ruochen Cao, Ruiying Du, Yang Liu, Ziming Zhao

AI总结:

针对现有智能合约模糊测试工具状态反馈不足、测试资源浪费的问题,提出以漏洞为导向的有向状态灰盒模糊测试工具Vulseye,通过代码与状态双目标引导及新型适应度度量提升测试的有效性与效率。

摘要:

智能合约是去中心化应用的基石,在革新数字格局方面的地位日益凸显。然而,智能合约中的漏洞会给用户资产带来巨大风险,并削弱人们对去中心化系统的整体信任。但当前的智能合约模糊测试工具在测试效率上未达预期,主要原因有二:其一,智能合约是有状态程序,现有方法主要以覆盖率为引导,缺乏来自合约状态的有效反馈,因此难以有效探索合约状态空间;其二,以覆盖率为引导的模糊测试工具旨在实现全面的程序覆盖,可能会在良性代码区域浪费测试资源,这种浪费在智能合约测试中更为严重,因为代码空间与状态空间的交织进一步提升了全面测试的复杂度。\n为应对这些挑战,我们提出了Vulseye——一种以漏洞为导向的智能合约有向状态灰盒模糊测试工具。与现有工作不同,Vulseye通过将测试资源优先分配给更易出现漏洞的代码区域和合约状态,实现了有向状态模糊测试。我们将代码目标(Code Targets)和状态目标(State Targets)引入模糊测试循环,作为Vulseye的测试目标:采用静态分析与模式匹配精准定位代码目标,提出一种可扩展的逆向分析算法确定状态目标;设计了一种新颖的适应度度量指标,利用合约代码空间与状态空间的双重反馈,引导模糊测试向这些目标推进。在代码目标与状态目标的引导下,Vulseye缓解了测试资源在良性代码区域的浪费问题,实现了高效的有状态模糊测试。与当前最先进的模糊测试工具相比,Vulseye展现出了更优的有效性与效率。

英文摘要:

Smart contracts, the cornerstone of decentralized applications, have become increasingly prominent in revolutionizing the digital landscape. However, vulnerabilities in smart contracts pose great risks to user assets and undermine overall trust in decentralized systems. But current smart contract fuzzers fall short of expectations in testing efficiency for two primary reasons. Firstly, smart contracts are stateful programs, and existing approaches, primarily coverage-guided, lack effective feedback from the contract state. Consequently, they struggle to effectively explore the contract state space. Secondly, coverage-guided fuzzers, aiming for comprehensive program coverage, may lead to a wastage of testing resources on benign code areas. This wastage worsens in smart contract testing, as the mix of code and state spaces further complicates comprehensive testing. To address these challenges, we propose Vulseye, a stateful directed graybox fuzzer for smart contracts guided by vulnerabilities. Different from prior works, Vulseye achieves stateful directed fuzzing by prioritizing testing resources to code areas and contract states that are more prone to vulnerabilities. We introduce Code Targets and State Targets into fuzzing loops as the testing targets of Vulseye. We use static analysis and pattern matching to pinpoint Code Targets, and propose a scalable backward analysis algorithm to specify State Targets. We design a novel fitness metric that leverages feedback from both the contract code space and state space, directing fuzzing toward these targets. With the guidance of code and state targets, Vulseye alleviates the wastage of testing resources on benign code areas and achieves effective stateful fuzzing. In comparison with state-of-the-art fuzzers, Vulseye demonstrated superior effectiveness and efficiency.

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

↑