Font Size: a A A

Research On Smart Contract Vulnerability Detection Method Based On Graph Theory

Posted on:2024-09-02Degree:MasterType:Thesis
Country:ChinaCandidate:J L MaFull Text:PDF
GTID:2558307079492724Subject:Electronic Information·Computer Technology (Professional Degree)
Abstract/Summary:PDF Full Text Request
Smart contracts,as a representative of the second generation of blockchain technology applications,are computer programs that can be custom developed and automatically executed by users according to relevant protocols and interfaces.The vulnerability of smart contracts in terms of underlying implementation technology,operating environment,and development language has led to an increasing number of malicious attacks in recent years,which have affected the normal function of the contracts and reduced their reliability and trust,and also caused huge economic losses due to their wide application in various trusted transaction scenarios.To solve this problem,the detection of vulnerabilities in smart contracts has become increasingly important.However,traditional vulnerability detection tools suffer from low detection accuracy and high time overhead.While some machine learning-based methods have shown promise in improving detection rates,they still face challenges such as poor problem transformation,loss of code semantic information,and high model training cost.To address these limitations,this paper proposes a vulnerability detection model for smart contracts based on graph theory.The model consists of a semantic graph generation method and a vulnerability detection scheme based on the Weisfeiler-Lehman approximate graph matching algorithm with subtree graph kernels.The semantic graph is a directed graph that is custom-built based on vulnerability principles and expert patterns.It fully considers code data flow and control flow dependencies and characterizes the syntax,semantics,structure,and behavior of the contract source code associated with the vulnerability.The vulnerability detection scheme utilizes the Weisfeiler-Lehman approximate graph matching algorithm with subtree graph kernels to calculate the feature vectors and similarity matrix of the contract semantic graph.Then,the representative feature vectors of each vulnerability are filtered to form a malicious feature library.Finally,the method determines whether a contract is vulnerable by calculating the similarity between its feature vectors and the vectors in the malicious feature library.Experiments show that the proposed method achieves an average detection rate of 90% for four types of vulnerabilities: timestamp dependency vulnerability,reentrancy vulnerability,delegatecall vulnerability,and integer overflow vulnerability,indicating that it can effectively detect vulnerabilities in smart contracts.In addition,through various comparison experiments,it is verified that compared with traditional automated vulnerability detection tools,the model in this paper not only has the best detection performance but also is the fastest among existing vulnerability detection tools;compared with Graph Convolutional Networks(GCN)algorithm,the Weisfeiler-Lehman approximate graph matching algorithm based on subtree graph kernel is more computationally efficient and achieves the best results in identifying graph isomorphism.Finally,real-world experiments demonstrate the usability of the model in realistic environments.
Keywords/Search Tags:Blockchain Technology, Smart Contracts, Proximity Graph Matching Algorithm, Vulnerability Detection, Semantic Graph
PDF Full Text Request
Related items