Lune

USENIX Security2024Top-tier venue

Using My Functions Should Follow My Checks: Understanding and Detecting Insecure OpenZeppelin Code in Smart Contracts

Han Liu, Daoyuan Wu, Yuqiang Sun, Haijun Wang, Kaixuan Li, Yang Liu, Yixiang Chen

Abstract

OpenZeppelin is a popular framework for building smart contracts. It provides common libraries (e.g., SafeMath), implementations of Ethereum standards (e.g., ERC20), and reusable components for access control and upgradability. However, unlike traditional software libraries, which are typically imported as static linking libraries or dynamic loading libraries, OpenZeppelin is utilized by Solidity contracts in the form of source code. As a result, developers often make custom modifications to their copies of OpenZeppelin code, which may lead to unintended security consequences. In this paper, we conduct the first systematic study on the security of OpenZeppelin code used in real-world contracts. Specifically, we focus on the security checks in the official OpenZeppelin library and examine whether they are faithfully enforced in the relevant OpenZeppelin functions of real contracts. To this end, we propose a novel tool named ZepScope that comprises two components: MINER and CHECKER. First, MINER analyzes the official OpenZeppelin functions to extract the facts of explicit checks (i.e., the checks defined within the functions) and implicit checks (i.e., the conditions of calling the functions). Second, based on the facts extracted by MINER, CHECKER examines real contracts to identify their OpenZeppelin functions, match their checks with those in the facts, and validate the consequences for those inconsistent checks. By overcoming multiple challenges in developing ZepScope, we obtain not only the first taxonomy of OpenZeppelin checks but also the comprehensive results of checking the top 35,882 contracts from three mainstream blockchains.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

5 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Have We Solved Access Control Vulnerability Detection in Smart Contracts? A Benchmark Study cites Empirical review of automated analysis tools on 47, 587 Ethereum smart contracts
  • Have We Solved Access Control Vulnerability Detection in Smart Contracts? A Benchmark Study cites Securify: Practical Security Analysis of Smart Contracts
  • TrapHunter: Exposing Covert Pathways in Trap Token Contracts cites VerX: Safety Verification of Smart Contracts
  • Demystifying OpenZeppelin's Own Vulnerabilities and Analyzing Their Propagation in Smart Contracts cites teEther: Gnawing at Ethereum to Automatically Exploit Smart Contracts
  • Demystifying OpenZeppelin's Own Vulnerabilities and Analyzing Their Propagation in Smart Contracts cites ZEUS: Analyzing Safety of Smart Contracts
  • Demystifying OpenZeppelin's Own Vulnerabilities and Analyzing Their Propagation in Smart Contracts cites Empirical review of automated analysis tools on 47, 587 Ethereum smart contracts
  • Demystifying OpenZeppelin's Own Vulnerabilities and Analyzing Their Propagation in Smart Contracts cites Securify: Practical Security Analysis of Smart Contracts
  • Empirical review of automated analysis tools on 47, 587 Ethereum smart contracts cites teEther: Gnawing at Ethereum to Automatically Exploit Smart Contracts
  • Empirical review of automated analysis tools on 47, 587 Ethereum smart contracts cites ZEUS: Analyzing Safety of Smart Contracts
  • Empirical review of automated analysis tools on 47, 587 Ethereum smart contracts cites Securify: Practical Security Analysis of Smart Contracts
  • SymGPT: Auditing Smart Contracts via Combining Symbolic Execution with Large Language Models cites teEther: Gnawing at Ethereum to Automatically Exploit Smart Contracts
  • SymGPT: Auditing Smart Contracts via Combining Symbolic Execution with Large Language Models cites ZEUS: Analyzing Safety of Smart Contracts
  • SymGPT: Auditing Smart Contracts via Combining Symbolic Execution with Large Language Models cites Demystifying OpenZeppelin's Own Vulnerabilities and Analyzing Their Propagation in Smart Contracts
  • SymGPT: Auditing Smart Contracts via Combining Symbolic Execution with Large Language Models cites VerX: Safety Verification of Smart Contracts
  • SymGPT: Auditing Smart Contracts via Combining Symbolic Execution with Large Language Models cites Securify: Practical Security Analysis of Smart Contracts
  • Securify: Practical Security Analysis of Smart Contracts cites ZEUS: Analyzing Safety of Smart Contracts
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers5

  1. Have We Solved Access Control Vulnerability Detection in Smart Contracts? A Benchmark StudyHan Liu, Daoyuan Wu, Yuqiang Sun, Shuai Wang et al.ASE 2025 · 1 citation
  2. Demystifying OpenZeppelin's Own Vulnerabilities and Analyzing Their Propagation in Smart ContractsHan Liu, Daoyuan Wu, Yuqiang Sun, Shuai Wang et al.ASE 2025 · 1 citation
  3. TrapHunter: Exposing Covert Pathways in Trap Token ContractsYin Wu, Yixuan Liu, Yi Li, Chenyang Peng et al.ISSTA 2026
  4. Tracing the Shadows: Automatic Tracking and Analysis of Crypto Money Laundering via Transaction Semantic AnalysisHao Wu, Haijun Wang, Shangwang Li, Yin Wu et al.ISSTA 2026
  5. SymGPT: Auditing Smart Contracts via Combining Symbolic Execution with Large Language ModelsShihao Xia, Mengting He, Shuai Shao, Tingting Yu et al.OOPSLA 2026

Builds on16

  1. Securify: Practical Security Analysis of Smart ContractsPetar Tsankov, Andrei Marian Dan, Dana Drachsler-Cohen, Arthur Gervais et al.CCS 2018 · 1,108 citations
  2. ZEUS: Analyzing Safety of Smart ContractsSukrit Kalra, Seep Goel, Mohan Dhawan, Subodh SharmaNDSS 2018 · 595 citations
  3. Empirical review of automated analysis tools on 47, 587 Ethereum smart contractsThomas Durieux, João F. Ferreira, Rui Abreu, Pedro CruzICSE 2020 · 373 citations
  4. teEther: Gnawing at Ethereum to Automatically Exploit Smart ContractsJohannes Krupp, Christian RossowUSENIX Security 2018 · 345 citations
  5. VerX: Safety Verification of Smart ContractsAnton Permenev, Dimitar Dimitrov, Petar Tsankov, Dana Drachsler-Cohen et al.S&P 2020 · 251 citations

Related papers

  1. Identifying Solidity Smart Contract API Documentation ErrorsChenguang Zhu, Ye Liu, Xiuheng Wu, Yi LiASE 2022 · 16 citations
  2. TokenScope: Automatically Detecting Inconsistent Behaviors of Cryptocurrency Tokens in EthereumTing Chen, Yufei Zhang, Zihao Li, Xiapu Luo et al.CCS 2019 · 140 citations
  3. Abusing the Ethereum Smart Contract Verification Services for Fun and ProfitPengxiang Ma, Ningyu He, Yuhua Huang, Haoyu Wang et al.NDSS 2024
  4. Revealing Hidden Threats: An Empirical Study of Library Misuse in Smart ContractsMingyuan Huang, Jiachi Chen, Zigui Jiang, Zibin ZhengICSE 2024 · 10 citations
  5. AChecker: Statically Detecting Smart Contract Access Control VulnerabilitiesAsem Ghaleb, Julia Rubin, Karthik PattabiramanICSE 2023 · 63 citations
Dusk over the sea between two cliffs drawn in fine vertical lines