Abstract
While Ethereum smart contracts enabled a wide range of blockchain applications, they are extremely vulnerable to different forms of security attacks. Due to the fact that transactions to smart contracts commonly involve cryptocurrency transfer, any successful attacks can lead to money loss or even financial disorder. In this paper, we focus on the overflow attacks in Ethereum, mainly because they are widely rooted in many smart contracts and comparatively easy to exploit. We have developed EASYFLOW, an overflow detector at the Ethereum Virtual Machine (EVM) level. The key insight behind EASYFLOW is a taint analysis-based tracking technique to analyze the propagation of involved taints. Specifically, EASYFLOW can not only divide smart contracts into safe contracts, manifested overflows, well-protected overflows, and potential overflows, but also automatically generate transactions to trigger potential overflows. In our preliminary evaluation, EASYFLOW managed to find potentially vulnerable Ethereum contracts with little runtime overhead.
Introduction
In the Ethereum ecosystem, "code is law," and that law often governs the movement of massive financial assets. However, these contracts are frequently susceptible to integer overflow vulnerabilities—arithmetic errors where a calculation exceeds the maximum capacity of a variable (e.g., a uint256 wrapping back to zero). A prominent example is the 2018 BecToken (BEC) exploit, where an overflow allowed attackers to generate an astronomical number of tokens, effectively crashing the token's value to zero.
Detecting these vulnerabilities is challenging for two primary reasons. First, triggering overflows often requires extreme, specific input values that traditional testing misses. Second, many developers use protection libraries like SafeMath. Naive security tools often flag these "protected" overflows as bugs, creating excessive "noise" and false positives for developers.
Methodology
EASYFLOW addresses these challenges through a dynamic tracking system integrated into an extended version of the go-ethereum client. The system architecture, detailed in Figure 1, utilizes three core pillars to ensure accuracy and exploitability verification.
- EVM-Level Taint Analysis: The tool marks data from transaction inputs as "tainted." As the EVM executes instructions like
ADD,MUL, orEXP, EASYFLOW tracks how these taints propagate through memory and the stack. - Classification Engine: Based on execution behavior, contracts are categorized into four states: Safe (no overflows), Manifested (actual overflow occurred), Well-Protected (overflow caught by contract logic), and Potential (tainted inputs could cause an overflow under different conditions).
- Automatic Transaction Generation: For "potential" overflows, EASYFLOW does not rely on heuristics alone. It automatically constructs new test transactions using boundary values (like
MAX_UINT256) to verify if the vulnerability can be triggered in the current state of the blockchain.
Evaluation and Results
The researchers evaluated EASYFLOW against real-world Ethereum Mainnet transactions and known vulnerable contracts. The tool demonstrated high accuracy by correctly identifying unprotected vulnerabilities in contracts like BecToken while recognizing that others, such as Lizun, were well-protected despite containing arithmetic that could technically overflow.
As shown in Figure 2, the preliminary evaluation on the Mainnet identified 465 manifested overflows and successfully triggered 3,871 potential overflows that were previously hidden. Performance analysis indicates that EASYFLOW is highly efficient; most analyses complete in under 300ms, and runtime overhead scales linearly, making it practical for real-time monitoring on standard Ethereum nodes.
Conclusion and Future Work
EASYFLOW provides a robust, state-aware approach to detecting integer overflows by analyzing EVM execution traces rather than just source code. By explicitly identifying protection patterns, it significantly reduces the false-positive rate common in static analysis tools. Future work will focus on generalizing the taint analysis framework to detect other vulnerability classes, such as re-entrancy, and integrating more sophisticated fuzzing or symbolic execution to enhance the transaction triggering logic.
Summary updated