Characterizing Ethereum Upgradable Smart Contracts and Their Security Implications

Xiaofan Li,Jin Yang,Jiaqi Chen,Yuzhe Tang,Xing Gao
2024-03-03
Abstract:Upgradeable smart contracts (USCs) have been widely adopted to enable modifying deployed smart contracts. While USCs bring great flexibility to developers, improper usage might introduce new security issues, potentially allowing attackers to hijack USCs and their users. In this paper, we conduct a large-scale measurement study to characterize USCs and their security implications in the wild. We summarize six commonly used USC patterns and develop a tool, USCDetector, to identify USCs without needing source code. Particularly, USCDetector collects various information such as bytecode and transaction information to construct upgrade chains for USCs and disclose potentially vulnerable ones. We evaluate USCDetector using verified smart contracts (i.e., with source code) as ground truth and show that USCDetector can achieve high accuracy with a precision of 96.26%. We then use USCDetector to conduct a large-scale study on Ethereum, covering a total of 60,251,064 smart contracts. USCDetecor constructs 10,218 upgrade chains and discloses multiple real-world USCs with potential security issues.
Cryptography and Security,Computational Engineering, Finance, and Science
What problem does this paper attempt to address?
### Problems the Paper Attempts to Solve The paper "Characterizing Ethereum Upgradable Smart Contracts and Their Security Implications" aims to address the security and flexibility issues of Ethereum upgradable smart contracts (USCs). Although upgradable smart contracts offer great flexibility by allowing developers to modify contracts after deployment, improper use of these contracts can introduce new security issues, even allowing attackers to hijack these contracts and their users. Specifically, the paper focuses on the following aspects: 1. **Identifying and Classifying Upgradable Smart Contracts**: - The authors summarize 6 common upgradable smart contract patterns and develop a tool (USCDetector) to identify these contracts without relying on source code. - USCDetector constructs the upgrade chain of upgradable contracts by collecting bytecode and transaction information, and discloses potential vulnerabilities. 2. **Evaluating the Effectiveness of the Tool**: - The authors use verified smart contracts (i.e., contracts with source code) as a benchmark to evaluate the accuracy of USCDetector, showing an accuracy rate of 96.26%. 3. **Large-Scale Study**: - The authors conduct a large-scale study using USCDetector on 60,251,064 smart contracts on Ethereum, constructing 10,218 upgrade chains, and discovering multiple real-world upgradable smart contracts with potential security issues. 4. **Revealing Security Risks**: - The paper details various security risks that upgradable smart contracts may have, including but not limited to: - Lack of restrictive checks on upgrade functions, which may allow anyone to hijack the contract. - Inadequate restrictive implementations, such as malicious users being able to destroy the contract by directly calling the self-destruct function in the logic contract. - Lack of checks on logic addresses, which may lead to irreversible destruction of the contract. - Contract version issues, such as old contracts still being used after migration, potentially leading to severe security problems. In summary, through systematic research and tool development, the paper aims to raise awareness of the security of upgradable smart contracts and provide developers with effective detection tools to reduce potential security threats.