Building Reuse-Sensitive Control Flow Graphs (CFGs) for EVM Bytecode

📅 2025-05-20
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
To address semantic ambiguity and redundant dependencies in EVM bytecode static analysis caused by compiler-level code reuse, this paper proposes the first reuse-sensitive control-flow graph (CFG) construction method. Our approach dynamically reconstructs context-aware CFGs by leveraging dynamic taint analysis to automatically identify code reuse contexts, followed by multi-context basic block comparison and on-demand code duplication. This overcomes the limitations of conventional reuse-agnostic modeling and enables synergistic static-dynamic analysis. Evaluated on 10,000 mainstream smart contracts, our method achieves a 99.94% execution trace coverage rate, a 97.02% F1-score for reuse identification, and F1-scores of 99.97% (for tx.origin vulnerabilities) and 99.67% (for reentrancy vulnerabilities), with an average analysis time of only 1.06 seconds.

Technology Category

Application Category

📝 Abstract
The emergence of smart contracts brings security risks, exposing users to the threat of losing valuable cryptocurrencies, underscoring the urgency of meticulous scrutiny. Nevertheless, the static analysis of smart contracts in EVM bytecode faces obstacles due to flawed primitives resulting from code reuse introduced by compilers. Code reuse, a phenomenon where identical code executes in diverse contexts, engenders semantic ambiguities and redundant control-flow dependencies within reuse-insensitive CFGs. This work delves into the exploration of code reuse within EVM bytecode, outlining prevalent reuse patterns, and introducing Esuer, a tool that dynamically identifies code reuse when constructing CFGs. Leveraging taint analysis to dynamically identify reuse contexts, Esuer identifies code reuse by comparing multiple contexts for a basic block and replicates reused code for a reuse-sensitive CFG. Evaluation involving 10,000 prevalent smart contracts, compared with six leading tools, demonstrates Esuer's ability to notably refine CFG precision. It achieves an execution trace coverage of 99.94% and an F1-score of 97.02% for accurate identification of reused code. Furthermore, Esuer attains a success rate of 99.25%, with an average execution time of 1.06 seconds, outpacing tools generating reuse-insensitive CFGs. Esuer's efficacy in assisting identifying vulnerabilities such as tx.origin and reentrancy vulnerabilities, achieving F1-scores of 99.97% and 99.67%, respectively.
Problem

Research questions and friction points this paper is trying to address.

Addresses semantic ambiguities in EVM bytecode due to code reuse
Improves CFG precision by dynamically identifying code reuse contexts
Enhances vulnerability detection in smart contracts via reuse-sensitive CFGs
Innovation

Methods, ideas, or system contributions that make the work stand out.

Dynamic code reuse identification via taint analysis
Reuse-sensitive CFG construction by replicating code
High precision with 99.94% trace coverage
🔎 Similar Papers
No similar papers found.
Dingding Wang
Dingding Wang
School of Cyber Science and Technology, Zhejiang University, Hangzhou, China
J
Jianting He
Blocksec Team, Hangzhou, China
Y
Yizheng Yang
School of Cyber Science and Technology, Zhejiang University, Hangzhou, China
L
Lei Wu
School of Cyber Science and Technology, Zhejiang University, Hangzhou, China
R
Rui Chang
School of Cyber Science and Technology, Zhejiang University, Hangzhou, China
Yajin Zhou
Yajin Zhou
Zhejiang University
Blockchain System Security