| Blockchain technology is a revolutionary innovation that has disrupted traditional business models and transaction methods through a decentralized,secure,and trustworthy value exchange system.Smart contracts are one of the most successful applications of blockchain technology,enabling automated execution and management and providing critical support for the development of blockchain applications.However,frequent security vulnerabilities in smart contracts present challenges to the development of blockchain technology,resulting not only in economic losses but also damaging people’s trust in blockchain technology,limiting its application scope.Currently,smart contract security vulnerability detection has become a hot topic in domestic and foreign research.However,there are many challenges to existing vulnerability detection methods.Traditional static analysis uses expert-defined logical rules to detect smart contract vulnerabilities,but it cannot detect complex logical smart contract vulnerabilities.Fuzz testing requires a large number of test cases and time to achieve sufficient code coverage to trigger vulnerabilities,and the quality of test cases is difficult to ensure.In contrast,deep learning-based vulnerability detection methods have higher efficiency and accuracy,can learn more complex patterns and rules from large amounts of data,but currently face issues such as insufficient training data sets,incomplete code feature representation,and insufficient granularity of vulnerability detection results.To address these challenges,this paper focuses on the abstract syntax tree(AST)generated by smart contracts and proposes a smart contract vulnerability detection method that combines AST paths and deep learning techniques to address the issues present in traditional deep learning approaches.Firstly,this paper proposes a smart contract vulnerability path extraction method based on AST syntax rules.The method designs corresponding detection rules based on the different manifestations of vulnerabilities in AST to obtain AST paths that may contain vulnerabilities.Based on this,this paper proposes an AST path-based vulnerability detection method,which encodes the AST paths that may contain vulnerabilities,aggregates the AST path vectors,and obtains a more comprehensive vector representation.Finally,this paper constructs a Bi-GRU network model based on the attention mechanism to learn the semantic and syntactic relationships between AST path sequences,focusing on the part that has vulnerabilities to improve the model’s generalization ability and accuracy,achieving precise detection of vulnerabilities and finer granularity of localization.Experimental results show that the method based on the combination of AST path and deep learning technology effectively improves the accuracy of vulnerability detection,which is better than existing smart contract vulnerability detection tools.This paper explores the possibility of combining AST path and deep learning in smart contract vulnerability detection,providing new research directions for future smart contract vulnerability detection. |