Hunting Vulnerable Smart Contracts via Graph Embedding Based Bytecode Matching
Top Cited Papers
- 8 January 2021
- journal article
- research article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Information Forensics and Security
- Vol. 16 (15566013) , 2144-2156
Abstract
Smart contract vulnerabilities have attracted lots of concerns due to the resultant financial losses. Matching-based detection methods extrapolating known vulnerabilities to unknown have proven to be effective in other platforms. However, directly adopting the technique to smart contracts is obstructed by two issues, i.e., diversity of bytecode generation resulting from the rapid evolution of compilers and interference of noise code easily caused by the homogeneous business logics. To address the problems, we propose contract bytecode-oriented normalization and slicing techniques to augment bytecode matching. Specifically, we conduct data- and instruction-level normalizations to uniform the bytecode generated by different compilers, and enforce contract-specific slicing by tracking data- and control-flows with simulated bytecode executions to prune the noise code as far as possible. Based on the above techniques, we design an unsupervised graph embedding algorithm to encode the code graphs into quantitatively comparable vectors. The potentially vulnerable smart contracts can be identified by measuring the similarities between their vectors and known vulnerable ones. Our evaluations have shown the efficiency (0.47 seconds per contract on average), effectiveness (160 verified true positives) and high precision (91.95% for top-ranked). It is worth noting that, we also identify dozens of honeypot contracts, further demonstrating the capability of our method.Keywords
Funding Information
- National Natural Science Foundation of China (U1836209, 61802413)
- Fundamental Research Funds for the Central Universities
- Research Funds of Renmin University of China (19XNLG02, 20XNLG03)
This publication has 22 references indexed in Scilit:
- Distributed Representations of Subgraphs2017
- Neural Network-based Graph Embedding for Cross-Platform Binary Code Similarity Detection2017
- In Code We Trust?2017
- VUDDY: A Scalable Approach for Vulnerable Code Clone Discovery2017
- Making Smart Contracts Smarter2016
- Scalable Graph-based Bug Search for Firmware Images2016
- discovRE: Efficient Cross-Architecture Identification of Bugs in Binary Code2016
- Generalized vulnerability extrapolation using abstract syntax trees2012
- PR-Miner2005
- The program dependence graph in a software development environment1984