Skip to main content
QUICK REVIEW

[Paper Review] Hunting for Re-Entrancy Attacks in Ethereum Smart Contracts via Static Analysis

Yuichiro Chinen, Naoto Yanai|arXiv (Cornell University)|Jul 2, 2020
Blockchain Technology Applications and Security26 references4 citations
TL;DR

This paper presents RA, a static analysis tool that detects re-entrancy vulnerabilities in Ethereum smart contracts using symbolic execution and SMT solving on EVM bytecodes. It precisely identifies vulnerabilities without false positives or negatives, requires no prior knowledge of attack patterns, and operates solely on deployed contract bytecode without executing transactions.

ABSTRACT

Ethereum smart contracts are programs that are deployed and executed in a consensus-based blockchain managed by a peer-to-peer network. Several re-entrancy attacks that aim to steal Ether, the cryptocurrency used in Ethereum, stored in deployed smart contracts have been found in the recent years. A countermeasure to such attacks is based on dynamic analysis that executes the smart contracts themselves, but it requires the spending of Ether and knowledge of attack patterns for analysis in advance. In this paper, we present a static analysis tool named extit{RA (Re-entrancy Analyzer)}, a combination of symbolic execution and equivalence checking by a satisfiability modulo theories solver to analyze smart contract vulnerabilities to re-entrancy attacks. In contrast to existing tools, RA supports analysis of inter-contract behaviors by using only the Etherum Virtual Machine bytecodes of target smart contracts, i.e., even without prior knowledge of attack patterns and without spending Ether. Furthermore, RA can verify existence of vulnerabilities to re-entrancy attacks without execution of smart contracts and it does not provide false positives and false negatives. We also present an implementation of RA to evaluate its performance in analyzing the vulnerability of deployed smart contracts to re-entrancy attacks and show that RA can precisely determine which smart contracts are vulnerable.

Motivation & Objective

  • To address the critical need for secure, precise analysis of deployed Ethereum smart contracts without requiring source code or execution.
  • To overcome the limitations of dynamic analysis, which demands Ether spending and prior knowledge of attack patterns.
  • To eliminate false positives and false negatives in re-entrancy vulnerability detection through formal verification techniques.
  • To enable inter-contract static analysis using only EVM bytecodes, ensuring compatibility with published and unpublished contracts.
  • To provide a scalable, accurate, and automated solution for identifying state-of-the-art re-entrancy attacks in real-world smart contracts.

Proposed method

  • RA constructs inter-contract control flow graphs (CFGs) using symbolic execution to emulate re-entrancy behavior across multiple contracts.
  • It models external contract calls symbolically, preserving the state transitions and potential re-entry points during analysis.
  • The tool employs the Z3 SMT solver to formally verify whether a re-entrancy vulnerability exists by checking the satisfiability of constraints derived from control flow and state changes.
  • Vulnerability detection is performed by analyzing whether a contract can be re-entered before its state is updated, using equivalence checking via SMT solving.
  • The approach operates solely on EVM bytecodes, enabling analysis of contracts even when source code is unavailable.
  • RA combines symbolic execution with SMT-based equivalence checking to ensure soundness and completeness in vulnerability detection.

Experimental results

Research questions

  • RQ1Can re-entrancy vulnerabilities in Ethereum smart contracts be detected with zero false positives and false negatives using only EVM bytecodes?
  • RQ2Can a static analysis tool detect advanced re-entrancy attacks that bypass existing tools without prior knowledge of attack patterns?
  • RQ3Is it possible to perform precise inter-contract analysis of smart contracts using symbolic execution and SMT solving on EVM bytecodes?
  • RQ4How effective is the proposed method in identifying real-world re-entrancy vulnerabilities in deployed contracts?
  • RQ5Can the tool scale to detect vulnerabilities in complex, many-to-many contract interaction scenarios?

Key findings

  • RA successfully detects re-entrancy vulnerabilities in real-world Ethereum smart contracts with 100% precision, reporting no false positives or false negatives.
  • The tool accurately identifies vulnerable contracts even when they rely on complex inter-contract call patterns that evade traditional symbolic execution tools.
  • RA's analysis is fully based on EVM bytecodes, enabling detection of vulnerabilities in contracts without published source code.
  • The integration of symbolic execution with Z3 SMT solving allows RA to formally verify the existence of re-entrancy flaws without executing transactions.
  • Evaluation on deployed contracts confirms RA's ability to precisely distinguish between vulnerable and non-vulnerable contracts.
  • RA's design is extensible and can be adapted to detect other vulnerabilities, such as time-dependent attacks using block timestamps.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.