arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2305.15829cs.SEcs.CR
收藏

NFT智能合约中缺陷的定义与检测

Definition and Detection of Defects in NFT Smart Contracts

Shuo Yang, Jiachi Chen, Zibin Zheng

AI总结:

本文针对NFT智能合约的安全问题,定义了5种缺陷并提出基于符号执行框架的检测工具NFTGuard,在16,527个合约中实现92.6%的精确度。

摘要:

近年来,非同质化代币(NFTs)的诞生引起了广泛关注。NFTs能够在区块链上代表用户的所有权,并因其受欢迎程度而经历了巨大的市场销售。不幸的是,NFTs的高价值也使其成为攻击者的目标。NFT智能合约中的缺陷可能被攻击者利用,从而损害NFT生态系统的安全性和可靠性。尽管这个问题很重要,但目前缺乏专注于分析NFT智能合约的系统性工作,这可能引发用户对NFT安全性的担忧。为了填补这一空白,本文介绍了NFT智能合约中的5种缺陷。每种缺陷都通过突出其特征和后果的代码示例进行定义和说明,并配以可能的修复方案。此外,我们提出了一种名为NFTGuard的工具,基于符号执行框架来检测我们定义的缺陷。具体而言,NFTGuard从合约抽象语法树(AST)中提取状态变量信息,这对于识别符号执行期间的变量加载和存储操作至关重要。此外,NFTGuard从字节码中恢复源代码级特征,以有效定位缺陷并根据预定义的检测模式报告它们。我们在16,527个真实世界的智能合约上运行了NFTGuard,并基于手动标记的结果进行了评估。我们发现1,331个合约包含至少一种5种缺陷,并且我们的工具实现的总体精确度为92.6%。

英文摘要:

Recently, the birth of non-fungible tokens (NFTs) has attracted great attention. NFTs are capable of representing users' ownership on the blockchain and have experienced tremendous market sales due to their popularity. Unfortunately, the high value of NFTs also makes them a target for attackers. The defects in NFT smart contracts could be exploited by attackers to harm the security and reliability of the NFT ecosystem. Despite the significance of this issue, there is a lack of systematic work that focuses on analyzing NFT smart contracts, which may raise worries about the security of users' NFTs. To address this gap, in this paper, we introduce 5 defects in NFT smart contracts. Each defect is defined and illustrated with a code example highlighting its features and consequences, paired with possible solutions to fix it. Furthermore, we propose a tool named NFTGuard to detect our defined defects based on a symbolic execution framework. Specifically, NFTGuard extracts the information of the state variables from the contract abstract syntax tree (AST), which is critical for identifying variable-loading and storing operations during symbolic execution. Furthermore, NFTGuard recovers source-code-level features from the bytecode to effectively locate defects and report them based on predefined detection patterns. We run NFTGuard on 16,527 real-world smart contracts and perform an evaluation based on the manually labeled results. We find that 1,331 contracts contain at least one of the 5 defects, and the overall precision achieved by our tool is 92.6%.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑