Skip to main content
QUICK REVIEW

[Paper Review] Security Analysis of EOSIO Smart Contracts

Ningyu He, Ruiyi Zhang|arXiv (Cornell University)|Mar 14, 2020
Advanced Malware Detection TechniquesComputer Science26 references15 citations
TL;DR

This paper presents EOSafe, the first static analysis framework for detecting vulnerabilities in EOSIO smart contracts at the WebAssembly (Wasm) bytecode level. By combining a symbolic execution engine, a customized EOSIO library emulator, and heuristic-driven detectors, EOSafe achieves a 98% F1-measure in vulnerability detection and identifies over 25% of 53,666 active EOSIO smart contracts as vulnerable, with 48 confirmed in-the-wild attacks causing at least $1.7M in losses.

ABSTRACT

The EOSIO blockchain, one of the representative Delegated Proof-of-Stake (DPoS) blockchain platforms, has grown rapidly recently. Meanwhile, a number of vulnerabilities and high-profile attacks against top EOSIO DApps and their smart contracts have also been discovered and observed in the wild, resulting in serious financial damages. Most of EOSIO's smart contracts are not open-sourced and they are typically compiled to WebAssembly (Wasm) bytecode, thus making it challenging to analyze and detect the presence of possible vulnerabilities. In this paper, we propose EOSAFE, the first static analysis framework that can be used to automatically detect vulnerabilities in EOSIO smart contracts at the bytecode level. Our framework includes a practical symbolic execution engine for Wasm, a customized library emulator for EOSIO smart contracts, and four heuristics-driven detectors to identify the presence of four most popular vulnerabilities in EOSIO smart contracts. Experiment results suggest that EOSAFE achieves promising results in detecting vulnerabilities, with an F1-measure of 98%. We have applied EOSAFE to all active 53,666 smart contracts in the ecosystem (as of November 15, 2019). Our results show that over 25% of the smart contracts are vulnerable. We further analyze possible exploitation attempts against these vulnerable smart contracts and identify 48 in-the-wild attacks (25 of them have been confirmed by DApp developers), resulting in financial loss of at least 1.7 million USD.

Motivation & Objective

  • To address the lack of automated tools for analyzing EOSIO smart contracts, which are typically compiled to Wasm and not open-sourced.
  • To overcome the challenges of analyzing Wasm bytecode due to its complex instruction set, nested control flow, and need for semantic context.
  • To detect four high-profile EOSIO-specific vulnerabilities—fake EOS, fake receipt, rollback, and missing permission check—automatically and accurately.
  • To evaluate the security posture of the entire EOSIO ecosystem at scale, identifying real-world exploitation attempts.

Proposed method

  • Design and implement a symbolic execution engine tailored for Wasm bytecode, using heuristic-guided path pruning to mitigate path explosion.
  • Develop a custom library emulator to simulate EOSIO-specific functions and data structures critical for vulnerability detection.
  • Build a plugin-based vulnerability detection framework that allows plugging in detectors for specific vulnerability patterns.
  • Implement four heuristic-driven detectors for the four most prevalent EOSIO vulnerabilities using semantic analysis of Wasm control flow and function arguments.
  • Integrate symbolic execution with the emulator to explore program paths and identify security flaws based on control and data flow analysis.
  • Apply the framework to all 53,666 active EOSIO smart contracts as of November 15, 2019, for large-scale vulnerability measurement.

Experimental results

Research questions

  • RQ1Can a static analysis framework effectively detect vulnerabilities in EOSIO smart contracts when they are compiled to Wasm and not open-sourced?
  • RQ2How effective is symbolic execution with path pruning in analyzing complex Wasm bytecode with nested control flow and advanced instructions?
  • RQ3To what extent do known high-profile vulnerabilities like fake EOS and fake receipt exist across the EOSIO ecosystem?
  • RQ4Can the framework identify real-world exploitation attempts, and what is the scale of financial impact from such attacks?

Key findings

  • EOSafe achieved an F1-measure of 98% in detecting vulnerabilities on a manually crafted benchmark of 52 smart contracts, demonstrating high precision and recall.
  • Over 25% of the 53,666 active EOSIO smart contracts analyzed were found to be vulnerable to at least one of the four targeted vulnerabilities.
  • The framework identified 48 in-the-wild attacks, 25 of which were confirmed by DApp developers, resulting in a financial loss of at least $1.7 million USD.
  • The study revealed that many vulnerable contracts were inactive or had low balances, suggesting attackers may target high-value contracts selectively.
  • The symbolic execution engine successfully mitigated path explosion through heuristic pruning, enabling scalable analysis of complex Wasm-based smart contracts.
  • The framework’s modular design allows extension to detect additional vulnerabilities, and it is generalizable to other Wasm-based systems beyond EOSIO.

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.