A Risk-Stratified Benchmark Dataset for Bad Randomness (SWC-120) Vulnerabilities in Ethereum Smart Contracts
Hadis Rezaei, Rahim Taheri, Francesco Palmieri

TL;DR
This paper introduces a large, validated dataset of Ethereum smart contracts with Bad Randomness vulnerabilities, enabling improved detection and risk assessment of exploitable contracts.
Contribution
It provides the first function-level validation and risk stratification dataset for Bad Randomness vulnerabilities in Ethereum smart contracts.
Findings
Current tools fail to detect complex randomness vulnerabilities.
Nearly half of initially protected contracts are actually exploitable.
Existing detection tools like Slither and Mythril miss all vulnerabilities in the dataset.
Abstract
Many Ethereum smart contracts rely on block attributes such as block.timestamp or blockhash to generate random numbers for applications like lotteries and games. However, these values are predictable and miner-manipulable, creating the Bad Randomness vulnerability (SWC-120) that has led to real-world exploits. Current detection tools identify only simple patterns and fail to verify whether protective modifiers actually guard vulnerable code. A major obstacle to improving these tools is the lack of large, accurately labeled datasets. This paper presents a benchmark dataset of 1,752 Ethereum smart contracts with validated Bad Randomness vulnerabilities. We developed a five-phase methodology comprising keyword filtering, pattern matching with 58 regular expressions, risk classification, function-level validation, and context analysis. The function-level validation revealed that 49% of…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsBlockchain Technology Applications and Security · Advanced Malware Detection Techniques · Security and Verification in Computing
