Skip to main content
QUICK REVIEW

[Paper Review] GasFuzz: Generating High Gas Consumption Inputs to Avoid Out-of-Gas Vulnerability.

Fuchen Ma, Ying Fu|arXiv (Cornell University)|Oct 6, 2019
Blockchain Technology Applications and SecurityComputer Science46 references11 citations
TL;DR

This paper proposes V-Gas, a feedback-directed mutational fuzzer that generates high gas consumption inputs to reduce underestimation of gas limits in Ethereum smart contracts. By constructing gas-weighted control flow graphs and guiding mutation with gas consumption feedback, V-Gas reduces underestimation from 44.02% to 13.86% and uncovers 25 previously unknown out-of-gas vulnerabilities, five of which received CVE identifiers.

ABSTRACT

The out-of-gas error occurs when smart contract programs are provided with inputs that cause excessive gas consumption, and would be easily exploited to make the DoS attack. Multiple approaches have been proposed to estimate the gas limit of a function in smart contracts to avoid such error. However, under estimation often happens when the contract is complicated. In this work, we propose V-Gas, which could automatically generate inputs that maximizes the gas cost and reduce the under estimation cases. V-Gas is designed based on feedback-directed mutational fuzz testing. First, V-Gas builds the gas weighted control flow graph (CFG) of functions in smart contracts. Then, V-Gas develops gas consumption guided selection and mutation strategies to generate the input that maximize the gas consumption. For evaluation, we implement V-Gas based on js-evm, a widely used ethereum virtual machine written in javascript, and conduct experiments on 736 real-world transactions recorded on Ethereum. 44.02\% of the transactions would have out-of-gas errors under the estimation results given by solc, means that the recorded real gas consumption for those recorded transactions is larger than the gas limit value estimated by solc. While V-Gas could reduce the under estimation ratio to 13.86\%. Furthermore, V-Gas has exposed 25 previously unknown out-of-gas vulnerabilities in those widely-used smart contracts, 5 of which have been assigned unique CVE identifiers in the US National Vulnerability Database.

Motivation & Objective

  • To address the persistent problem of gas limit underestimation in Ethereum smart contracts, which leads to out-of-gas errors and potential DoS exploits.
  • To improve the accuracy of gas limit estimation for complex smart contracts where static analysis tools like solc often fail.
  • To develop an automated input generation technique that maximizes gas consumption to expose underestimation risks.
  • To identify previously undetected out-of-gas vulnerabilities in widely deployed smart contracts.

Proposed method

  • Construct a gas-weighted control flow graph (CFG) for each function in a smart contract to model gas consumption across execution paths.
  • Apply feedback-directed mutational fuzzing, where mutation strategies are guided by real-time gas consumption feedback to evolve inputs.
  • Use gas consumption as a fitness metric to select and prioritize input mutations that increase gas usage.
  • Integrate the fuzzer into js-evm, a JavaScript-based Ethereum virtual machine, to enable accurate gas measurement on real transactions.
  • Evaluate generated inputs against 736 real-world Ethereum transactions to measure underestimation reduction and vulnerability discovery.

Experimental results

Research questions

  • RQ1Can feedback-directed mutational fuzzing effectively generate inputs that maximize gas consumption in smart contracts?
  • RQ2To what extent can V-Gas reduce the rate of gas limit underestimation compared to static analysis tools like solc?
  • RQ3How many previously unknown out-of-gas vulnerabilities can V-Gas discover in real-world smart contracts?
  • RQ4Can the discovered vulnerabilities be independently validated and assigned CVE identifiers?

Key findings

  • V-Gas reduces the gas limit underestimation rate from 44.02% to 13.86% when evaluated on 736 real Ethereum transactions.
  • The tool successfully exposed 25 previously unknown out-of-gas vulnerabilities in widely used smart contracts.
  • Five of the discovered vulnerabilities were assigned unique CVE identifiers in the US National Vulnerability Database, confirming their severity and reproducibility.
  • The gas-weighted CFG and feedback-directed mutation strategy significantly improve the detection of high-cost execution paths.
  • The results demonstrate that dynamic, feedback-driven fuzzing is more effective than static analysis in identifying gas-related vulnerabilities.

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.