VFIX: Facilitating Software Maintenance of Smart Contracts via Automatically Fixing Vulnerabilities

Pengcheng Fang, Peng Gao, Yun Peng, Qingzhao Zhang, Tao Xie, Dawn Song, Prateek Mittal, Sanjeev Kulkarni, Zhuotao Liu, Xusheng Xiao

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

The increased adoption of smart contracts in many industries has made them an attractive target for cybercriminals, leading to millions of dollars in losses. Thus, continuously fixing newly found vulnerabilities of smart contracts becomes a routine software maintenance task for running smart contracts. However, fixing the vulnerabilities that are specific to the smart contract domain requires security knowledge that many developers lack. Without effective tool support, this task can be very costly in terms of manual labor. To fill this critical need, in this paper, we propose VFIX, which automatically generates security patches for vulnerable smart contracts. In particular, VFIX provides a novel program analysis framework that can incorporate different fix patterns for fixing various types of vulnerabilities. To address the unique challenges in accurately fixing smart contract vulnerabilities, VFIX innovatively combines template-based repair with a set of static program analysis techniques specially designed for smart contracts. Specifically, given an input smart contract, VFIX conducts ensemble identification based on multiple static verification tools to identify vulnerabilities for an automatic fix. Then, VFIX generates patches using template-based fix patterns, and conducts static program analysis (e.g., program dependency computation, pointer analysis) for smart contracts to accurately infer and populate the parameter values for the fix templates. Finally, VFIX performs static verification to ensure that the patched contract is free of vulnerabilities. Our evaluations on 144 real smart contracts containing different types of vulnerabilities show that VFIX can successfully fix 94% of the vulnerabilities and preserve the expected normal behaviors of the smart contracts.

Original languageEnglish (US)
Title of host publicationProceedings - 2024 IEEE International Conference on Software Maintenance and Evolution, ICSME 2024
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages13-24
Number of pages12
ISBN (Electronic)9798350395686
DOIs
StatePublished - 2024
Event40th IEEE International Conference on Software Maintenance and Evolution, ICSME 2024 - Flagstaff, United States
Duration: Oct 6 2024Oct 11 2024

Publication series

NameProceedings - 2024 IEEE International Conference on Software Maintenance and Evolution, ICSME 2024

Conference

Conference40th IEEE International Conference on Software Maintenance and Evolution, ICSME 2024
Country/TerritoryUnited States
CityFlagstaff
Period10/6/2410/11/24

Keywords

  • Program Analysis
  • Smart Contract Security
  • Static Verification
  • Vulnerability Patch

ASJC Scopus subject areas

  • Artificial Intelligence
  • Computer Science Applications
  • Software
  • Safety, Risk, Reliability and Quality

Fingerprint

Dive into the research topics of 'VFIX: Facilitating Software Maintenance of Smart Contracts via Automatically Fixing Vulnerabilities'. Together they form a unique fingerprint.

Cite this