Advanced Smart Contract Vulnerability Detection using Large Language Models

被引:0
|
作者
Erfan, Fatemeh [1 ]
Yahyatabar, Mohammad [1 ]
Bellaiche, Martine [1 ]
Halabi, Talal [2 ]
机构
[1] Polytech Montreal, Dept Comp & Software Engn, Montreal, PQ, Canada
[2] Univ Laval, Dept Comp Sci, Quebec City, PQ, Canada
关键词
smart contract vulnerability; large language model; GPT; security detection; Ethereum; solidity code analysis;
D O I
10.1109/CSNET64211.2024.10851734
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
With the rapid expansion of using smart contracts, protecting the security of these contracts has become crucial. Existing analysis tools for detecting vulnerabilities in smart contracts are unreliable as they often fall short in accuracy, primarily due to their low recall rates-a significant challenge in this field. In this work, we utilize the open-source SolidiFi benchmark dataset to detect vulnerabilities related to Integer overflow/underflow (IoU), reentrancy (RE), and timestamp dependency (TD). These contracts, verified and available on Etherscan, proved unsuitable for direct application of LLMs due to comments, functions, and variables that might reveal the nature of the vulnerabilities. To address this, we performed several preprocessing steps to prepare the dataset for further research. We utilize a large language model to identify vulnerable code, provide reasoning for the vulnerabilities, explain how an attacker might exploit them, and propose fixed code. We design our prompts using chain-of-thought and expert patterns. Finally, we evaluate the results using various metrics and expert reviewers to assess the correctness of the reasoning, potential security risks, and code fixes. Our experiments demonstrate that our approach outperforms existing tools and methods. Notably, our recall rates are significantly high-93.5%, 95.4%, and 93.8%-addressing the challenge of low recall in detecting IoU, RE, and TD vulnerabilities, respectively.
引用
收藏
页码:289 / 296
页数:8
相关论文
共 50 条
  • [21] Smart process automation using Large Language Models
    Matuschek, Mario
    ATP MAGAZINE, 2025, (03):
  • [22] Smart contract vulnerability detection combined with multi-objective detection
    Zhang, Lejun
    Wang, Jinlong
    Wang, Weizheng
    Jin, Zilong
    Su, Yansen
    Chen, Huiling
    COMPUTER NETWORKS, 2022, 217
  • [23] Smart Contract Vulnerability Detection Based on Multimodal Feature Fusion
    Yu, Jie
    Yu, Xiao
    Li, Jiale
    Sun, Haoxin
    Sun, Mengdi
    ADVANCED INTELLIGENT COMPUTING TECHNOLOGY AND APPLICATIONS, PT III, ICIC 2024, 2024, 14864 : 344 - 355
  • [24] Contractsentry: a static analysis tool for smart contract vulnerability detection
    Wang, Shiji
    Zhao, Xiangfu
    AUTOMATED SOFTWARE ENGINEERING, 2025, 32 (01)
  • [25] Smart Contract Vulnerability Detection Based on Symbolic Execution Technology
    Liu, Yiping
    Xu, Jie
    Cui, Baojiang
    CYBER SECURITY, CNCERT 2021, 2022, 1506 : 193 - 207
  • [26] Smart contract vulnerability detection based on a bytecode critical path
    Yin, Guisheng
    Gao, Le
    Zhuang, Yuan
    Li, Jun
    Harbin Gongcheng Daxue Xuebao/Journal of Harbin Engineering University, 2022, 43 (02): : 255 - 261
  • [27] Smart Contract Timestamp Vulnerability Detection Based on Code Homogeneity
    Wang, Weizhi
    Xia, Lei
    Zhang, Zhuo
    Meng, Xiankai
    IEICE TRANSACTIONS ON INFORMATION AND SYSTEMS, 2024, E107D (10) : 1362 - 1366
  • [28] QuadraCode AI: Smart Contract Vulnerability Detection with Multimodal Representation
    Upadhya, Jiblal
    Upadhyay, Kritagya
    Sainju, Arpan
    Poudel, Samir
    Hasan, Md Nahid
    Poudel, Khem
    Ranganathan, Jaishree
    2024 33RD INTERNATIONAL CONFERENCE ON COMPUTER COMMUNICATIONS AND NETWORKS, ICCCN 2024, 2024,
  • [29] Towards Auto Contract Generation and Ensemble-based Smart Contract Vulnerability Detection
    Puducherry, K. Lakshminarayana
    Puducherry, K. Sathiyamurthy
    INTERNATIONAL JOURNAL OF ELECTRICAL AND COMPUTER ENGINEERING SYSTEMS, 2022, 13 (09) : 747 - 757
  • [30] Automatic smart contract comment generation via large language models and in-context learning
    Zhao, Junjie
    Chen, Xiang
    Yang, Guang
    Shen, Yiheng
    INFORMATION AND SOFTWARE TECHNOLOGY, 2024, 168