Smart Contract Vulnerability Detection Based on Symbolic Execution Technology

Yiping Liu, Jie Xu, Baojiang CuiCommunications 2022 · DOI · OpenAlex

Abstract

With the rapid development of blockchain, smart contract technology has been widely applied. However, the correctness and security of smart contracts face significant challenges. Vulnerabilities like the DAO exploit and Parity multi-signature wallet hacks have led to losses in the hundreds of millions of dollars. This project presents a vulnerability detection system for Ethereum smart contracts. The system generates a control flow graph (CFG) from assembly instruction sequences, then performs symbolic execution and vulnerability constraint solving. It detects common vulnerabilities such as integer overflow/underflow, reentrancy, and unchecked call return values with high accuracy, providing automated vulnerability reports.

Introduction

Smart contracts are self-executing programs on the blockchain that often manage millions of dollars in digital assets. Unlike traditional software, once a smart contract is deployed to the Ethereum network, its code is immutable—it cannot be "patched" in the traditional sense. Historical exploits have demonstrated that simple coding oversights can lead to catastrophic financial losses. As thousands of new contracts are deployed daily, manual auditing cannot keep pace. There is an urgent need for automated, high-accuracy tools that can scan contract bytecode for devastating security flaws before they are exploited.

Methodology

The proposed system utilizes a multi-stage pipeline to analyze contracts, capable of processing both source code and raw Ethereum Virtual Machine (EVM) bytecode.

System architecture for smart contract vulnerability detection.

The detection process follows these key steps:

  1. Decompilation: The system translates EVM bytecode into a sequence of opcodes (assembly-level instructions).
  2. Control Flow Graph (CFG) Generation: It maps out all possible execution paths, identifying jumps, loops, and branches.
  3. Symbolic Execution: Instead of concrete execution, the system uses "symbols" to represent variables. It traverses the CFG using a Depth-First Search (DFS) approach, building a mathematical model of every reachable state.
  4. Constraint Solving (Z3): Symbolic paths are converted into logical constraints. The Z3 solver—a state-of-the-art theorem prover—determines if any input could trigger a "vulnerability state."

The tool specifically targets three major vulnerability types: Reentrancy (checking for call instructions providing >2,300 gas), Integer Overflow/Underflow, and Unchecked Call Return Values. By focusing on EVM bytecode rather than Solidity source code, the tool can analyze any contract currently live on the blockchain, even if the developers haven't made their source code public.

Experimental Results

The system was evaluated using the awesome-buggy-erc20-tokens dataset, containing 1,552 smart contracts with known security flaws.

Key results include:

  • Detection Performance: The tool identified vulnerabilities in 1,320 contracts, achieving an overall accuracy of 85.1%.
  • Manual Verification: A manual audit of 20 flagged contracts confirmed 100% accuracy for those specific reports, including a confirmed integer overflow at address 0x0b76...c02A.
  • Vulnerability Distribution: "Unchecked call return value" was the most frequently detected bug, followed by "Integer overflow," with "Reentrancy" being the least common in this dataset.

Conclusion and Future Work

This research demonstrates the effectiveness of symbolic execution and constraint solving in securing the blockchain ecosystem. While the system currently supports 117 out of 142 EVM instructions, future work will focus on expanding this set to eliminate "blind spots." Additionally, the researchers aim to address "path explosion" in complex contracts and explore the automation of "suggested fixes" for developers based on the generated vulnerability reports.

Summary updated

Abstract

Abstract With the rapid development of the blockchain, smart contract technology has been widely applied. The number of smart contracts has grown at a high rate and nearly at an average of thousands per day. However, the correctness and security of the smart contract itself are facing huge problems. The well-known DAO vulnerability, and Parity multi-signature wallet’ vulnerabilities have leaded to a hundreds of millions dollars loss, and they are both caused by the security problems of smart contracts. Once the smart contract vulnerability is exploited, it is very likely to bring the loss of cryptocurrencies, the disorder of the financial order and other catastrophic consequences. Therefore the security of smart contracts is imminent. This project has designed and implemented a vulnerability detection system of Ethereum smart contract. The system uses the assembly instruction sequences of the smart contract to generate the control flow graph, then performs symbolic execution and vulnerability constraint solving over the control flow. The system can detect some common types of vulnerabilities, such as the integer overflow and underflow vulnerability, reentry vulnerability and unchecked call return value vulnerability. It has a high accuracy of detection result, and gives support for export vulnerability report.
BibTeX
@inproceedings{liu2022smart,
  author = {Yiping Liu and Jie Xu and Baojiang Cui},
  title = {{Smart Contract Vulnerability Detection Based on Symbolic Execution Technology}},
  booktitle = {Communications},
  year = {2022},
  doi = {10.1007/978-981-16-9229-1\_12},
}
Figure