VulFinder: Exploring Chaincode Vulnerabilities More Effectively and Efficiently Using Knowledge Graph Based Defect Pattern Matching
Hyperledger Fabric is an open-source project of Linux Foundation, it is a modular blockchain framework and has become an unofficial standard for enterprise blockchain platforms. In Hyperledger Fabric, smart contract is also known as chaincode, which are usually written using general-purpose languages, including Go, Java or Node.js etc. Although there are some vulnerability detection methods for Java and Node.js, there are very few vulnerability detection methods for Go, especially when it is used as a smart contract programming language in Hyperledger Fabric. <p xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">In this article, we propose a knowledge graph based defect pattern matching method and develop a tool called <i>VulFinder</i> to detect vulnerabilities in chaincode, i.e. the smart contracts written using Go language. Knowledge graph is used because it can fully retain the syntax and logic information of smart contracts. The method consists of two key steps: a knowledge graph is constructed from <i>Go language specification</i> and chaincode source code, including the definition of ontology layer and the construction of instance layer; the defect patterns are defined and SPARQL query statements are used to match and locate vulnerabilities on the knowledge graph. To evaluate the detection effectiveness and efficiency of <i>VulFinder</i>, we construct two datasets through manual analysis and vulnerabilities injection due to the lack of public datasets. Experimental results show that <i>VulFinder</i> can detect 22 kinds of typical vulnerabilities of chaincode effectively, and the <i>recall</i> is as high as 98.87%, while the <i>false negative rate</i> is as low as 1.13% .
Authors
- Bixin Li (ORCID: https://orcid.org/0000-0001-9916-4790)
- Tianyuan Hu (ORCID: https://orcid.org/0000-0002-5431-9346)
- Lulu Wang (ORCID: https://orcid.org/0000-0002-8575-4172)
- Xiangfei Xu
Institutions
- Nanjing Tech University (CN)
- Southeast University (CN)
Publication Details
- Journal
- IEEE Transactions on Software Engineering
- Published
- 2025-09-02
- DOI
- https://doi.org/10.1109/tse.2025.3605379
- Primary Topic
- Advanced Malware Detection Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00