PrettySmart: Detecting Permission Re-delegation Vulnerability for Token Behaviors in Smart Contracts

Zhijie Zhong,Zibin Zheng,Hong-Ning Dai,Qing Xue,Junjia Chen,Yuhong Nan
DOI: https://doi.org/10.1145/3597503.3639140
2024-01-01
Abstract:As an essential component in Ethereum and other blockchains, token assets have been interacted with by diverse smart contracts. Effective permission policies of smart contracts must prevent token assets from being manipulated by unauthorized adversaries. Recent efforts have studied the accessibility of privileged functions or state variables to unauthorized users. However, little attention is paid to how publicly accessible functions of smart contracts can be manipulated by adversaries to steal users' digital assets. This attack is mainly caused by the permission re-delegation (PRD) vulnerability. In this work, we propose PRETTYSMART, a bytecode-level Permission re-delegation vulnerability detector for Smart contracts. Our study begins with an empirical study on 0.43 million open- source smart contracts, revealing that five types of widely-used permission constraints dominate 98% of the studied contracts. Accordingly, we propose a mechanism to infer these permission constraints, as well as an algorithm to identify constraints that can be bypassed by unauthorized adversaries. Based on the identification of permission constraints, we propose to detect whether adversaries could manipulate the privileged token management functionalities of smart contracts. The experimental results on real-world datasets demonstrate the effectiveness of the proposed Prettysmart, which achieves the highest precision score and detects 118 new PRD vulnerabilities.
What problem does this paper attempt to address?