跳到主要导航 跳到搜索 跳到主要内容

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
  • East China Normal University
  • Hong Kong University of Science and Technology
  • Nanyang Technological University

科研成果: 书/报告/会议事项章节会议稿件同行评审

8 引用 (Scopus)

摘要

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.

源语言英语
主期刊名Proceedings of the 33rd USENIX Security Symposium
出版商USENIX Association
3585-3601
页数17
ISBN(电子版)9781939133441
出版状态已出版 - 2024
活动33rd USENIX Security Symposium, USENIX Security 2024 - Philadelphia, 美国
期限: 14 8月 202416 8月 2024

丛书

姓名Proceedings of the 33rd USENIX Security Symposium

会议

会议33rd USENIX Security Symposium, USENIX Security 2024
国家/地区美国
Philadelphia
时期14/08/2416/08/24

学术指纹

探究 'Using My Functions Should Follow My Checks: Understanding and Detecting Insecure OpenZeppelin Code in Smart Contracts' 的科研主题。它们共同构成独一无二的学术指纹。

引用此