<p>SCs are self-executing programs on the blockchain, used for transactions without intermediaries, particularly in cryptocurrencies like Ethereum. However, they are vulnerable to security flaws that can lead to significant financial losses, as demonstrated by the DAO hack 2016. Common vulnerabilities include re-entrancy errors, timestamp dependency, infinite loops, and integer overflows. Detecting these flaws is crucial but complex due to the immutable nature of the blockchain and the complexity of the contracts. Therefore, developing techniques for analyzing, testing, and verifying the security of SCs is essential to ensure their reliability and safety. This work presents a novel approach to detecting vulnerabilities in SCs using deep learning. Our SCs vulnerability detection method leverages expert knowledge, masked attention, and deep learning to analyze bytecode. Key steps include constructing a Control Flow Graph (CFG) from bytecode, normalizing the graph by cleaning nodes to retain only opcode instructions, and applying a masked attention mechanism to identify and prioritize critical opcodes. The different graphs obtained are vectorized using Graph2Vec, preparing them for NN processing. Finally, a Recurrent Neural Network (RNN) detects vulnerabilities efficiently and accurately in SCs. The proposed model’s performance is evaluated by dataset BCCC-VolSCs-2023 using precision, recall, and F1-score metrics. These metrics collectively offer a comprehensive understanding of the model’s effectiveness, emphasizing the quality, completeness, and accuracy of its positive predictions.</p>

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

A deep learning-based vulnerability detection in blockchain smart contracts using masked attention and control flow graph analysis

  • Maëlle Gautrin,
  • Arash Habibi Lashkari,
  • Sepideh HajiHosseinKhani

摘要

SCs are self-executing programs on the blockchain, used for transactions without intermediaries, particularly in cryptocurrencies like Ethereum. However, they are vulnerable to security flaws that can lead to significant financial losses, as demonstrated by the DAO hack 2016. Common vulnerabilities include re-entrancy errors, timestamp dependency, infinite loops, and integer overflows. Detecting these flaws is crucial but complex due to the immutable nature of the blockchain and the complexity of the contracts. Therefore, developing techniques for analyzing, testing, and verifying the security of SCs is essential to ensure their reliability and safety. This work presents a novel approach to detecting vulnerabilities in SCs using deep learning. Our SCs vulnerability detection method leverages expert knowledge, masked attention, and deep learning to analyze bytecode. Key steps include constructing a Control Flow Graph (CFG) from bytecode, normalizing the graph by cleaning nodes to retain only opcode instructions, and applying a masked attention mechanism to identify and prioritize critical opcodes. The different graphs obtained are vectorized using Graph2Vec, preparing them for NN processing. Finally, a Recurrent Neural Network (RNN) detects vulnerabilities efficiently and accurately in SCs. The proposed model’s performance is evaluated by dataset BCCC-VolSCs-2023 using precision, recall, and F1-score metrics. These metrics collectively offer a comprehensive understanding of the model’s effectiveness, emphasizing the quality, completeness, and accuracy of its positive predictions.