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 条
  • [41] Sóley: Automated detection of logic vulnerabilities in Ethereum smart contracts using large language models☆
    Soud, Majd
    Nuutinen, Waltteri
    Liebel, Grischa
    JOURNAL OF SYSTEMS AND SOFTWARE, 2025, 226
  • [42] Smart Contract Vulnerability Detection Based on Hybrid Attention Mechanism Model
    Wu, Huaiguang
    Dong, Hanjie
    He, Yaqiong
    Duan, Qianheng
    APPLIED SCIENCES-BASEL, 2023, 13 (02):
  • [43] Smart Contract Vulnerability Detection Based on Prompt-guided ChatGPT
    Ma, Jiarun
    Feng, Shiling
    Zeng, Jiahao
    Lu, Jia
    Chen, Jie
    2024 INTERNATIONAL CONFERENCE ON NETWORKING AND NETWORK APPLICATIONS, NANA 2024, 2024, : 321 - 326
  • [44] A Novel Smart Contract Reentrancy Vulnerability Detection Model based on BiGAS
    Zhang, Lejun
    Li, Yuan
    Guo, Ran
    Wang, Guopeng
    Qiu, Jing
    Su, Shen
    Liu, Yuan
    Xu, Guangxia
    Chen, Huiling
    Tian, Zhihong
    JOURNAL OF SIGNAL PROCESSING SYSTEMS FOR SIGNAL IMAGE AND VIDEO TECHNOLOGY, 2024, 96 (03): : 215 - 237
  • [45] CBGRU: A Detection Method of Smart Contract Vulnerability Based on a Hybrid Model
    Zhang, Lejun
    Chen, Weijie
    Wang, Weizheng
    Jin, Zilong
    Zhao, Chunhui
    Cai, Zhennao
    Chen, Huiling
    SENSORS, 2022, 22 (09)
  • [46] Smart contract: a survey towards extortionate vulnerability detection and security enhancement
    S. Porkodi
    D. Kesavaraja
    Wireless Networks, 2024, 30 : 1285 - 1304
  • [47] Smart Contract Vulnerability Detection Based on Code Graph Embedding Approach
    Zhai, Yiwen
    Yang, Jia
    Zhang, Mingwu
    FRONTIERS IN CYBER SECURITY, FCS 2024, PT I, 2024, 2315 : 317 - 332
  • [48] An integrated deep learning model for Ethereum smart contract vulnerability detection
    Vikas Kumar Jain
    Meenakshi Tripathi
    International Journal of Information Security, 2024, 23 : 557 - 575
  • [49] Verbal lie detection using Large Language Models
    Loconte, Riccardo
    Russo, Roberto
    Capuozzo, Pasquale
    Pietrini, Pietro
    Sartori, Giuseppe
    SCIENTIFIC REPORTS, 2023, 13 (01)
  • [50] Explaining Misinformation Detection Using Large Language Models
    Pendyala, Vishnu S.
    Hall, Christopher E.
    ELECTRONICS, 2024, 13 (09)