[论文解读] xFuzz: Machine Learning Guided Cross-Contract Fuzzing
xFuzz 是一种基于机器学习的模糊测试工具,通过分析多个智能合约之间的交互,检测以太坊智能合约中的跨合约漏洞。它利用学习到的特征(如词向量和字节码指令)来过滤良性执行路径,在检测到18个可利用漏洞(其中15个为新发现)的同时,所用时间不足其他模糊测试工具的20%。
Smart contract transactions are increasingly interleaved by cross-contract calls. While many tools have been developed to identify a common set of vulnerabilities, the cross-contract vulnerability is 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字节码的指令级特征在内的程序特征。
- 基于这些特征训练机器学习模型,以预测某条程序路径为良性路径的可能性,从而在模糊测试过程中修剪不可利用的路径。
- 将模型集成到模糊测试引擎中,以探索跨合约执行流,并优先处理风险评分较高的路径。
- 系统使用符号执行和约束求解,生成能够触发复杂跨合约交互的输入。
- 最终通过动态分析由机器学习模型识别出的高风险路径,完成漏洞检测。
实验结果
研究问题
- RQ1机器学习模型能否有效区分以太坊智能合约中跨合约执行路径的良性与恶意路径?
- RQ2与传统模糊测试和静态分析相比,基于机器学习引导的模糊测试在检测跨合约漏洞方面的性能如何?
- RQ3基于机器学习的路径过滤在多大程度上能减少搜索空间,同时不降低漏洞检测覆盖率?
- RQ4该框架能否检测到现有工具遗漏的未知跨合约漏洞?
- RQ5与最先进工具相比,xFuzz在检测跨合约与非跨合约漏洞方面的效率如何?
主要发现
- xFuzz 在 7,391 个智能合约中检测到 18 个可利用的跨合约漏洞,其中 15 个为此前未知。
- 该框架识别出了三款最先进工具未能发现的真实合约中的漏洞。
- xFuzz 在使用时间不足其他模糊测试工具 20% 的情况下,漏洞检测率是其他工具的两倍。
- 与基于规则的过滤相比,机器学习模型展现出更优的鲁棒性,在无需人工调优的情况下显著降低了误报率。
- 该系统同样有效检测了非跨合约漏洞,表明其适用范围不仅限于主要研究目标。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。