Skip to main content
QUICK REVIEW

[Paper Review] xFuzz: Machine Learning Guided Cross-Contract Fuzzing

Yinxing Xue, Jiaming Ye|arXiv (Cornell University)|Nov 24, 2021
Advanced Malware Detection TechniquesComputer Science42 references11 citations
TL;DR

xFuzz is a machine learning-guided fuzzer that detects cross-contract vulnerabilities in Ethereum smart contracts by analyzing interactions across multiple contracts. It uses learned features like word vectors and bytecode instructions to filter benign execution paths, outperforming existing tools by detecting 18 exploitable vulnerabilities—15 previously unknown—while using under 20% of the time required by other fuzzers.

ABSTRACT

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.

Motivation & Objective

  • To address the gap in existing tools that cannot detect vulnerabilities arising from interactions across more than two smart contracts.
  • To reduce the high search space complexity of analyzing multiple interacting contracts in fuzzing.
  • To improve detection accuracy and efficiency by replacing rule-based filtering with machine learning models trained on program features.
  • To enable scalable and precise fuzzing of cross-contract interactions in Ethereum smart contracts.

Proposed method

  • The framework constructs a multi-contract execution graph by statically analyzing inter-contract call relationships across a set of smart contracts.
  • It extracts program features including word vectors from function names and variable identifiers, and instruction-level features from EVM bytecode.
  • A machine learning model is trained on these features to predict the likelihood of a program path being benign, thereby pruning non-exploitable paths during fuzzing.
  • The model is integrated into a fuzzing engine that explores cross-contract execution flows, prioritizing paths with higher risk scores.
  • The system uses symbolic execution and constraint solving to generate inputs that trigger complex cross-contract interactions.
  • The final vulnerability detection is performed via dynamic analysis of high-risk paths identified by the ML model.

Experimental results

Research questions

  • RQ1Can machine learning models effectively distinguish between benign and malicious cross-contract execution paths in Ethereum smart contracts?
  • RQ2How does the performance of ML-guided fuzzing compare to traditional fuzzing and static analysis in detecting cross-contract vulnerabilities?
  • RQ3To what extent can ML-based path filtering reduce the search space without sacrificing vulnerability detection coverage?
  • RQ4Can the framework detect previously unknown cross-contract vulnerabilities that existing tools miss?
  • RQ5How efficient is xFuzz in detecting both cross-contract and non-cross-contract vulnerabilities compared to state-of-the-art tools?

Key findings

  • xFuzz detected 18 exploitable cross-contract vulnerabilities across 7,391 smart contracts, with 15 of them being previously unknown.
  • The framework identified vulnerabilities in real-world contracts that were missed by three state-of-the-art tools.
  • xFuzz achieved twice the vulnerability detection rate of other fuzzing tools while using less than 20% of the execution time.
  • The machine learning model demonstrated superior robustness compared to rule-based filtering, reducing false positives without manual tuning.
  • The system effectively detected non-cross-contract vulnerabilities as well, showing broader applicability beyond its primary focus.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.