Skip to main content
QUICK REVIEW

[论文解读] Machine Learning Guided Cross-Contract Fuzzing

Yinxing Xue, Jiaming Ye|arXiv (Cornell University)|Nov 24, 2021
Advanced Malware Detection Techniques参考文献 35被引用 7
一句话总结

该论文提出 xFuzz,一种基于机器学习的模糊测试框架,通过利用词向量和低级指令等学习到的特征来过滤良性执行路径,从而检测以太坊智能合约中的跨合约漏洞。xFuzz 在检测到 18 个可利用的跨合约漏洞(其中 15 个为此前未知)的同时,将运行时间减少至其他模糊测试工具的 20% 以下,并将漏洞检测率提高了一倍。

ABSTRACT

Smart contract transactions are increasingly interleaved by cross-contract calls. While many tools have been developed to identify a common set of vulnerabilities to guard smart contracts, the cross-contract vulnerability is however overlooked by existing tools. Cross-contract vulnerabilities are exploitable bugs that manifest in the presence of more than two interacting contracts. Existing methods are however limited to analyze a maximum of two contracts at the same time. Detecting cross-contract vulnerabilities is highly non-trivial. With multiple interacting contracts, the search space is much larger than that of a single contract. To address this problem, we present xFuzz, a machine learning guided smart contract fuzzing framework. The machine learning models are trained with novel features (e.g., word vectors and instructions) and are used to filter likely benign program paths. Comparing with existing static tools, machine learning model is proven to be more robust, avoiding directly adopting manually-defined rules in specific tools. We compare xFuzz with three state-of-the-art tools on 7,391 contracts. xFuzz detects 18 exploitable cross-contract vulnerabilities, of which 15 vulnerabilities are exposed for the first time. Furthermore, our approach is shown to be efficient in detecting non-cross-contract vulnerabilities as well-using less than 20% time as that of other fuzzing tools, xFuzz detects twice as many vulnerabilities.

研究动机与目标

  • 为现有工具在检测涉及超过两个交互合约的跨合约漏洞方面存在的不足提供解决方案。
  • 通过利用机器学习建模多个合约之间的复杂交互模式,克服静态分析和基于规则的模糊测试的局限性。
  • 通过利用代码语义和控制流中学习到的特征,过滤掉可能为良性路径的执行路径,从而缩小模糊测试的搜索空间。
  • 与现有最先进的模糊测试和静态分析工具相比,提升检测跨合约漏洞的效率与效果。

提出的方法

  • 该框架使用基于新型特征训练的机器学习模型,包括从合约代码中提取的词向量和低级 EVM 指令,以表示程序语义。
  • 利用这些模型预测某条程序路径为良性路径的可能性,从而在模糊测试过程中剪枝搜索空间,集中关注高风险路径。
  • 系统在多个交互合约之间执行符号执行,生成测试输入以探索复杂的跨合约交互。
  • 将机器学习模型作为模糊测试流水线中的过滤器,优先对风险评分较高的路径进行深入分析。
  • 该方法设计具有鲁棒性和可泛化性,避免依赖先前工具中使用的手动编写启发式规则。
  • 该框架在 7,391 个真实世界的智能合约上进行了评估,以衡量检测覆盖率和效率。

实验结果

研究问题

  • RQ1基于语义和语法特征训练的机器学习模型能否有效缩小智能合约中跨合约漏洞检测的搜索空间?
  • RQ2与传统的静态分析和基于规则的模糊测试相比,机器学习引导的模糊测试在检测跨合约漏洞方面的性能如何?
  • RQ3在不依赖手动定义规则的前提下,学习到的模型在多样化智能合约交互中具有多大程度的泛化能力?
  • RQ4集成机器学习过滤是否能同时提升跨合约场景下的检测速度和检测到的漏洞数量?

主要发现

  • xFuzz 在 7,391 个智能合约中检测到 18 个可利用的跨合约漏洞,其中 15 个为此前未知。
  • 该框架将运行时间减少至其他模糊测试工具所需时间的 20% 以下,同时检测到的漏洞数量是其两倍。
  • 与基于规则的方法相比,机器学习模型表现出更优的鲁棒性,避免了手动定义启发式规则的脆弱性。
  • xFuzz 成功以更高效率识别出非跨合约漏洞,进一步验证了其在主攻目标(跨合约问题)之外的通用实用性。
  • 使用词向量和 EVM 指令序列作为模型特征,显著提升了模型区分良性与恶意执行路径的能力。

更好的研究,从现在开始

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

无需绑定信用卡

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