Demystifying Random Number in Ethereum Smart Contract: Taxonomy, Vulnerability Identification, and Attack Detection

04/25/2023
by   Peng Qian, et al.
0

Recent years have witnessed explosive growth in blockchain smart contract applications. As smart contracts become increasingly popular and carry trillion dollars worth of digital assets, they become more of an appealing target for attackers, who have exploited vulnerabilities in smart contracts to cause catastrophic economic losses. Notwithstanding a proliferation of work that has been developed to detect an impressive list of vulnerabilities, the bad randomness vulnerability is overlooked by many existing tools. In this paper, we make the first attempt to provide a systematic analysis of random numbers in Ethereum smart contracts, by investigating the principles behind pseudo-random number generation and organizing them into a taxonomy. We also lucubrate various attacks against bad random numbers and group them into four categories. Furthermore, we present RNVulDet - a tool that incorporates taint analysis techniques to automatically identify bad randomness vulnerabilities and detect corresponding attack transactions. To extensively verify the effectiveness of RNVulDet, we construct three new datasets: i) 34 well-known contracts that are reported to possess bad randomness vulnerabilities, ii) 214 popular contracts that have been rigorously audited before launch and are regarded as free of bad randomness vulnerabilities, and iii) a dataset consisting of 47,668 smart contracts and 49,951 suspicious transactions. We compare RNVulDet with three state-of-the-art smart contract vulnerability detectors, and our tool significantly outperforms them. Meanwhile, RNVulDet spends 2.98s per contract on average, in most cases orders-of-magnitude faster than other tools. RNVulDet successfully reveals 44,264 attack transactions. Our implementation and datasets are released, hoping to inspire others.

READ FULL TEXT

page 4

page 15

research
05/02/2019

Bug Searching in Smart Contract

With the frantic development of smart contracts on the Ethereum platform...
research
06/26/2019

Cryptocurrency Smart Contracts for Distributed Consensus of Public Randomness

Most modern electronic devices can produce a random number. However, it ...
research
01/15/2021

The Eye of Horus: Spotting and Analyzing Attacks on Ethereum Smart Contracts

In recent years, Ethereum gained tremendously in popularity, growing fro...
research
02/07/2020

Formalising and verifying smart contracts with Solidifier: a bounded model checker for Solidity

The exploitation of smart-contract vulnerabilities can have catastrophic...
research
02/16/2019

Precise Attack Synthesis for Smart Contracts

Smart contracts are programs running on top of blockchain platforms. The...
research
12/23/2022

Front-Running Attack Benchmark Construction and Vulnerability Detection Technique Evaluation

Front-running attacks have been a major concern on the blockchain. Attac...
research
05/15/2023

DAppSCAN: Building Large-Scale Datasets for Smart Contract Weaknesses in DApp Projects

The Smart Contract Weakness Classification Registry (SWC Registry) is a ...

Please sign up or login with your details

Forgot password? Click here to reset