TL;DR
This paper presents the first comprehensive empirical study of vulnerabilities in the core systems of major blockchains (Bitcoin, Ethereum, Monero, Stellar). By developing a novel filtering framework and analyzing over 1,000 vulnerabilities, the authors identify susceptible modules, categorize vulnerability types (including new blockchain-specific ones), and extract 21 reusable code patterns that can help detect similar security flaws in other blockchain projects.
What Problem Does This Paper Address?
While smart contract vulnerabilities have been a hot research topic, the security of the underlying blockchain systems themselves has been largely overlooked. These core systems are complex, distributed software projects, and like any software, they are prone to bugs. However, unlike typical software, blockchain vulnerabilities can have far-reaching consequences, impacting the integrity of cryptocurrencies and decentralized applications. Existing research has only scratched the surface, with limited studies analyzing a small number of bugs. This paper aims to fill this gap by systematically investigating system-level vulnerabilities across several prominent blockchains.
Methods
The authors employed a multi-stage approach:
- Systematic Data Collection and Filtering: They crawled GitHub repositories for four major blockchains (Bitcoin, Ethereum, Monero, Stellar), collecting over 34,000 issues/pull requests (PRs) and 85,000 commits. A key challenge was distinguishing real vulnerabilities from regular bugs. To address this, they developed a novel seven-step vulnerability filtering framework that leverages commit-based, file-based, label-based, and keyword-based analysis. This process yielded a dataset of 1,037 vulnerabilities and their 2,317 corresponding patches.
- File-Level Module Analysis: They categorized vulnerable code changes by identifying module paths (folder names) within the patched files. To compare across different blockchains, they mapped these paths to a reference architecture (Bitcoin Core) and identified modules that were disproportionately affected by vulnerabilities.
- Text-Level Vulnerability Type Clustering: They analyzed the text of vulnerability titles using Natural Language Processing (NLP) techniques. After pre-processing and extracting keywords, they used Word Mover's Distance (WMD) and Agglomerative Clustering to group similar vulnerability types, identifying both traditional and novel blockchain-specific categories.
- Code-Level Vulnerability Pattern Analysis: For blockchain-specific vulnerabilities, they generated "code change signatures" that capture the essence of code modifications in patches. These signatures were then clustered using Normalized Levenshtein distance to identify reusable vulnerability patterns.
Datasets
The primary dataset used in this study is a newly curated Blockchain Vulnerability Dataset. This dataset comprises:
- Source: GitHub repositories of Bitcoin, Ethereum, Monero, and Stellar.
- Raw Data: 34,245 closed issues/PRs and 85,164 commits.
- Filtered Data: 1,037 identified vulnerabilities and their 2,317 associated patches.
This dataset is made publicly available at https://github.com/VPRLab/BlkVulnDataset. The authors note that this dataset differs from prior work by focusing on system-level vulnerabilities rather than smart contracts and by employing a systematic filtering process due to the scarcity of CVEs for blockchain systems.
Key Insights and Ideas
- Module Susceptibility: Not all parts of a blockchain are equally prone to bugs. The study highlights that core modules like consensus, wallet, and networking are significantly more vulnerable, suggesting these areas require extra scrutiny.
- Evolving Threat Landscape: While many blockchain vulnerabilities are rooted in traditional software flaws (e.g., race conditions, deadlocks), the research identifies four new vulnerability types that are specific to the unique characteristics of blockchains (transactions, blocks, peer interactions, and wallet management).
- Reusable Security Patterns: The paper extracts 21 distinct blockchain-specific vulnerability patterns. These patterns are not just descriptions of specific bugs but generalized code change signatures that capture how vulnerabilities manifest and are fixed in blockchain code. This is a crucial insight for proactive security.
- Impact of Code Reuse: The study demonstrates that blockchains often reuse code from established projects. This makes them susceptible to the same vulnerabilities, and the identified patterns can be powerful tools for finding these "code clones" in newer or less-audited projects.
Key Results
- The filtering framework successfully identified 1,037 vulnerabilities and 2,317 patches from a large corpus of issues and commits.
- Consensus, Wallet, and Networking modules each had over 200 reported issues, indicating they are critical areas for security.
- Approximately 70% of vulnerabilities are traditional types, but four new blockchain-specific types were identified.
- 21 blockchain-specific vulnerability patterns were extracted.
- Applying these patterns to other blockchains (Dogecoin, Bitcoin SV, Zcash) led to the discovery of 20 similar vulnerabilities, many of which were confirmed and are being patched.
Limitations and Future Work
- Manual Verification: While the filtering framework is systematic, the authors acknowledge that the precision of their initial filtering was 82.5%, implying some false positives might exist. The final dataset was manually examined, but the initial filtering relied on automated processes.
- Scope of Analysis: The study focused on four representative blockchains. While these are major players, other blockchains might exhibit different vulnerability profiles.
- Future Work: The authors explicitly state that a thorough detection of blockchain system vulnerabilities based on the extracted patterns is a key direction for future research. They also suggest exploring more advanced variant search techniques for applying the discovered patterns to new codebases.
Summary updated