MultiCFV: Detecting Control Flow Vulnerabilities in Smart Contracts Leveraging Multimodal Deep Learning
Hongli Peng, Xiaoqi Li, Wenkai Li · 2025
Read MultiCFV: Detecting Control Flow Vulnerabilities in Smart Contracts Leveraging Multimodal Deep Learning by Hongli Peng, Xiaoqi Li, Wenkai Li (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2508-01346.txt.
Introduction
Hongli Peng, Xiaoqi Li, and Wenkai Li fuse three views of smart contract code to catch control flow flaws. Their 2025 paper addresses a costly risk: buggy contracts on blockchains have lost users large sums. Most past detectors read code in one mode only, which caps accuracy and reach.
Their system, MultiCFV, builds flow graphs from compiled code and embeds their shape. Syntax trees add a second feature set, and code comments add key word signals. The three vectors merge into one store for inspection. That store drives both flaw detection for faulty control flow and clone detection for copied code. Tests show the fused view lifts accuracy over single-mode tools, the authors report.
Catalog record
| CREATOR | Hongli Peng, Xiaoqi Li, Wenkai Li |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 44 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2508-01346
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
MultiCFV: Detecting Control Flow Vulnerabilities in Smart Contracts Leveraging Multimodal Deep Learning Hongli Peng, Xiaoqi Li, Wenkai Li Abstract The introduction of smart contract functionality marks the advent of the blockchain 2.0 era, enabling blockchain technology to support digital currency transactions and complex distributed applications. However, many smart contracts have been found to contain vulnerabilities and errors, leading to the loss of assets within the blockchain. Despite a range of tools that have been developed to identify vulnerabilities in smart contracts at the source code or bytecode level, most rely on a single modality, reducing performance, accuracy, and limited generalization capabilities. This paper proposes a multimodal deep learning approach, MultiCFV, which is designed specifically to analyze and detect erroneous control flow vulnerability, as well as identify code clones in smart contracts. Bytecode is generated from source code to construct control flow graphs, with graph embedding techniques extracting graph features. Abstract syntax trees are used to obtain syntax features, while code comments capture key commentary words and comment features. These three feature vectors are fused to create a database for code inspection, which is used to detect similar code and identify contract vulnerabilities. Experimental results demonstrate our method effectively combines structural, syntactic, and semantic information, improving the accuracy of smart contract vulnerability detection and clone detection. 1 Introduction The concept of smart contracts was first introduced by computer scientist Nick Szabo in 1994 and gradually received significant attention with the emergence of Bitcoin in 2008 Nakamoto 2008 . A smart contract is an automated agreement that operates on blockchain technology, removing the need for third-party involvement. These contracts commonly involve transactions such as the transfer of cryptocurrency or digital assets, which are automatically executed when predefined conditions are met. This automation spans various fields, making smart contracts tamper-resistant and ensuring transparency and reliability in transactions Kuo and Pham 2023 ; Subramanian and Subramanian 2022 ; Qi et al. 2023 . However, the substantial value of the assets involved makes smart contracts prime targets for attackers looking to exploit vulnerabilities or errors in the contract’s code. For instance, on October 7, 2023, the cryptocurrency exchange Mixin Network was hacked, resulting in a loss of approximately $200 million Toulas 2024 . Due to the immutable nature of smart contracts, they cannot be altered once deployed on the blockchain. Therefore, it is crucial to minimize vulnerabilities and errors in the code before deployment to enhance the security of the contract. Significant research efforts have led to advancements in blockchain systems and the development of tools designed to analyze and prevent smart contract vulnerabilities He et al. 2023 ; di Angelo et al. 2023 . Nevertheless, these tools still face several limitations. For instance, some tools require experts to define error patterns and detection rules that are not only time-consuming and labor-intensive but also struggle to address new or variant vulnerabilities effectively Liu et al. 2021 ; Lin et al. 2023 . To overcome the time-consuming and labor-intensive, certain tools utilize deep learning models to identify specific patterns or features associated with vulnerabilities Wu et al. 2021 ; Yu et al. 2021 ; Gao 2020 . However, these tools primarily operate from the unimodal perspective, which often results in extracted features failing to fully capture the semantic information, leading to reduced detection accuracy and compromised reliability Adami 2016 . In this paper, a novel approach MultiCFV is proposed to overcome these challenges through multimodal deep learning for smart contract clone detection and vulnerability verification. Our approach focuses on three key aspects: (1) Deep Learning Techniques: Deep learning is utilized to learn patterns and features of smart contract vulnerabilities, eliminating reliance on expert-defined detection rules and code design, which enables faster and more efficient detection. (2) Accuracy and Generalization: Detection accuracy and generalization capabilities are significantly enhanced through the use of multimodal deep learning. (3) Comment Information: To further improve detection accuracy, additional code information and features are extracted from comments within the code. These comments often provide insights into the function’s purpose and considerations, offering valuable supplementary data. The main contributions of this paper are as follows: 1. We propose a novel type of vulnerability and conduct an in-depth analysis. To the best of our knowledge, it’s the first application of multimodal deep learning to smart contracts with erroneous control flow vulnerabilities. 2. We propose an innovative feature extraction approach by using multimodal deep learning and graph embedding techniques. Our approach overcomes the limitations of unimodal methods while enhancing detection accuracy and robustness. We integrate control flow graphs generated from bytecode, abstract syntax trees(AST) derived from source code, and code comments. 3. We introduce comment word embeddings as supplementary features for smart contracts. We highlight the importance of comments and include them in the feature set, thereby improving detection accuracy and overall performance. 4. We have uploaded the source code, experimental data, and comprehensive README documentation of MultiCFV. These resources ensure the reproducibility of our work and will be made open-source following the paper’s publication. Specifically, in the phrase of code clone detection, the source code is not used directly as feature vectors. Instead, emphasis is placed on the control flow and semantic structure of smart contracts. Our approach avoids interference from irrelevant items such as variable and function names, leading to superior performance in both accuracy and generalization capability. 2 Background 2.1 Erroneous Control Flow Vulnerabilities Erroneous control flow vulnerabilities in smart contracts refer to design or implementation flaws that occur when handling exceptions or errors Li et al. 2024a ; Liu et al. 2024 ; Li et al. 2024b . These flaws can result in the smart contract failing to properly manage error situations, leading to unexpected behaviors or security issues. Among the most common and severe erroneous control flow vulnerabilities in smart contracts is the reentrancy vulnerability Xue et al. 2020 ; Wu et al. 2021 . Reentrancy allows an attacker to repeatedly call a function during its execution, preventing the contract’s state from being updated promptly and creating significant security risks Li et al. 2024e ; Bu et al. 2025a ; Li et al. 2024c ; Bu et al. 2025b ; Niu et al. 2024 ; Zou et al. 2025 ; Chen et al. 2018 . To prevent such vulnerabilities, smart contracts must rigorously verify the correctness and security of their behavior flows Li et al. 2024e ; Li et al. 2024b ; Li et al. 2024d . In addition to reentrancy, other critical vulnerabilities include impermissible access control flaws, dangerous delegatecall vulnerabilities, and unchecked external call vulnerabilities Zheng et al. 2024 ; Wu et al. 2025 . Our detection focuses primarily on these four types of vulnerabilities. The rationale for focusing on these vulnerabilities is detailed in Appendix A.1 . 2.2 Control Flow Graph The Control Flow Graph (CFG) consists of basic blocks and control flow edges Li et al. 2017 ; Li and others 2021 . Basic blocks are sequences of consecutive instructions in a program that contain no branches, representing a single execution unit Contro et al. 2021 . In this paper, basic blocks are composed of bytecode blocks formed by Ethereum Virtual Machine (EVM) instruction sequences Zhong et al. 2023 . Branch instructions (e.g., JUMP, JUMPI, RETURN)