CONTRACTFIX: A Framework for Automatically Fixing Vulnerabilities in Smart Contracts

07/18/2023
by   Pengcheng, et al.
0

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, deploying smart contracts with detected vulnerabilities (known to developers) are not acceptable, and fixing all the detected vulnerabilities is needed, which incurs high manual labor cost without effective tool support. To fill this need, in this paper, we propose ContractFix, a novel framework that automatically generates security patches for vulnerable smart contracts. ContractFix is a general framework that can incorporate different fix patterns for different types of vulnerabilities. Users can use it as a security fix-it tool that automatically applies patches and verifies the patched contracts before deploying the contracts. To address the unique challenges in fixing smart contract vulnerabilities, given an input smart contract, conducts our proposed ensemble identification based on multiple static verification tools to identify vulnerabilities that are amenable for automatic fix. Then, ContractFix generates patches using template-based fix patterns and conducts program analysis (program dependency computation and pointer analysis) for smart contracts to accurately infer and populate the parameter values for the fix patterns. Finally, ContractFix performs static verification that guarantees the patched contract is free of vulnerabilities. Our evaluations on 144 real vulnerable contracts demonstrate that can successfully fix 94% of the detected vulnerabilities (565 out of 601) and preserve the expected behaviors of the smart contracts.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/29/2020

EOSFuzzer: Fuzzing EOSIO Smart Contracts for Vulnerability Detection

EOSIO is one typical public blockchain platform. It is scalable in terms...
research
03/17/2021

Assessing Smart Contracts Security Technical Debts

Smart contracts are self-enforcing agreements that are employed to excha...
research
11/25/2021

ESBMC-Solidity: An SMT-Based Model Checker for Solidity Smart Contracts

Smart contracts written in Solidity are programs used in blockchain netw...
research
06/21/2023

Do you still need a manual smart contract audit?

We investigate the feasibility of employing large language models (LLMs)...
research
12/20/2021

Relational Models of Microarchitectures for Formal Security Analyses

There is a growing need for hardware-software contracts which precisely ...
research
08/23/2021

Elysium: Automagically Healing Vulnerable Smart Contracts Using Context-Aware Patching

Smart contracts are programs that are deployed and executed on the block...
research
03/18/2022

Extorsionware: Exploiting Smart Contract Vulnerabilities for Fun and Profit

Smart Contracts (SCs) publicly deployed on blockchain have been shown to...

Please sign up or login with your details

Forgot password? Click here to reset