Skip to main content
QUICK REVIEW

[Paper Review] Machine Learning Guided Cross-Contract Fuzzing

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

This paper proposes xFuzz, a machine learning-guided fuzzing framework that detects cross-contract vulnerabilities in Ethereum smart contracts by leveraging learned features such as word vectors and low-level instructions to filter benign execution paths. xFuzz outperforms state-of-the-art tools by detecting 18 exploitable cross-contract vulnerabilities—15 previously unknown—while reducing runtime to under 20% of other fuzzing tools and doubling vulnerability detection rates.

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.

Motivation & Objective

  • To address the gap in existing tools that fail to detect cross-contract vulnerabilities involving more than two interacting contracts.
  • To overcome the limitations of static analysis and rule-based fuzzing by leveraging machine learning to model complex interaction patterns across multiple contracts.
  • To reduce the search space in fuzzing by filtering out likely benign execution paths using learned features from code semantics and control flow.
  • To improve both efficiency and effectiveness in detecting cross-contract vulnerabilities compared to existing state-of-the-art fuzzing and static analysis tools.

Proposed method

  • The framework uses machine learning models trained on novel features including word vectors derived from contract code and low-level EVM instructions to represent program semantics.
  • It applies these models to predict the likelihood of a program path being benign, thereby pruning the search space during fuzzing to focus on high-risk paths.
  • The system performs symbolic execution across multiple interacting contracts, generating test inputs that explore complex cross-contract interactions.
  • It integrates the ML model as a filter within a fuzzing pipeline, prioritizing paths with higher risk scores for deeper analysis.
  • The approach is designed to be robust and generalizable, avoiding reliance on manually crafted heuristics used in prior tools.
  • The framework is evaluated on 7,391 real-world smart contracts to measure detection coverage and efficiency.

Experimental results

Research questions

  • RQ1Can machine learning models trained on semantic and syntactic features effectively reduce the search space for cross-contract vulnerability detection in smart contracts?
  • RQ2How does the performance of ML-guided fuzzing compare to traditional static analysis and rule-based fuzzing in detecting cross-contract vulnerabilities?
  • RQ3To what extent can a learned model generalize across diverse smart contract interactions without relying on manually defined rules?
  • RQ4Does the integration of ML filtering improve both the speed and the number of vulnerabilities detected in cross-contract scenarios?

Key findings

  • xFuzz detected 18 exploitable cross-contract vulnerabilities across 7,391 smart contracts, with 15 of them being previously unknown.
  • The framework reduced runtime to less than 20% of that required by other fuzzing tools while detecting twice as many vulnerabilities.
  • The machine learning model demonstrated superior robustness compared to rule-based approaches, avoiding the brittleness of manually defined heuristics.
  • xFuzz successfully identified non-cross-contract vulnerabilities with higher efficiency, further validating its general utility beyond the primary focus on cross-contract issues.
  • The use of word vectors and EVM instruction sequences as model features significantly improved the model's ability to distinguish benign from malicious execution paths.

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.