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 条
  • [1] Automated Smart Contract Vulnerability Detection using Fine-tuned Large Language Models
    Yang, Zhiju
    Man, Gaoyuan
    Yue, Songqing
    6TH INTERNATIONAL CONFERENCE ON BLOCKCHAIN TECHNOLOGY AND APPLICATIONS, ICBTA 2023, 2023, : 19 - 23
  • [2] Smart Contract Vulnerability Detection: The Role of Large Language Model (LLM)
    Boi, Biagio
    Esposito, Christian
    Lee, Sokjoon
    APPLIED COMPUTING REVIEW, 2024, 24 (02): : 19 - 29
  • [3] Enhancing smart contract security: Leveraging pre-trained language models for advanced vulnerability detection
    He F.
    Li F.
    Liang P.
    IET Blockchain, 2024, 4 (S1): : 543 - 554
  • [4] Large Language Model-Powered Smart Contract Vulnerability Detection: New Perspectives
    Hu, Sihao
    Huang, Tiansheng
    Ilhan, Fatih
    Tekin, Selim Furkan
    Liu, Ling
    2023 5TH IEEE INTERNATIONAL CONFERENCE ON TRUST, PRIVACY AND SECURITY IN INTELLIGENT SYSTEMS AND APPLICATIONS, TPS-ISA, 2023, : 297 - 306
  • [5] Software Vulnerability Detection using Large Language Models
    Das Purba, Moumita
    Ghosh, Arpita
    Radford, Benjamin J.
    Chu, Bill
    2023 IEEE 34TH INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING WORKSHOPS, ISSREW, 2023, : 112 - 119
  • [6] Smart Contract Vulnerability Detection with Self-ensemble Pre-trained Language Models
    Dai, Chaofan
    Ding, Huahua
    Ma, Wubin
    Wu, Yahui
    2024 INTERNATIONAL CONFERENCE ON COMPUTER, INFORMATION AND TELECOMMUNICATION SYSTEMS, CITS 2024, 2024, : 118 - 125
  • [7] Enhancing Multi-label Vulnerability Detection of Smart Contract using Language Model
    Duong Vu
    Tuan Nguyen
    Van Tong
    Souihi, Sami
    2023 5TH CONFERENCE ON BLOCKCHAIN RESEARCH & APPLICATIONS FOR INNOVATIVE NETWORKS AND SERVICES, BRAINS, 2023,
  • [8] Finetuning Large Language Models for Vulnerability Detection
    Shestov, Aleksei
    Levichev, Rodion
    Mussabayev, Ravil
    Maslov, Evgeny
    Zadorozhny, Pavel
    Cheshkov, Anton
    Mussabayev, Rustam
    Toleu, Alymzhan
    Tolegen, Gulmira
    Krassovitskiy, Alexander
    IEEE ACCESS, 2025, 13 : 38889 - 38900
  • [9] Leveraging Large Language Models for Automatic Smart Contract Generation
    Napoli, Emanuele Antonio
    Barbara, Fadi
    Gatteschi, Valentina
    Schifanella, Claudio
    2024 IEEE 48TH ANNUAL COMPUTERS, SOFTWARE, AND APPLICATIONS CONFERENCE, COMPSAC 2024, 2024, : 701 - 710
  • [10] An interpretable model for large-scale smart contract vulnerability detection
    Feng, Xia
    Liu, Haiyang
    Wang, Liangmin
    Zhu, Huijuan
    Sheng, Victor S.
    BLOCKCHAIN-RESEARCH AND APPLICATIONS, 2024, 5 (03):