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 条
  • [31] Harnessing Large Language Models for Software Vulnerability Detection: A Comprehensive Benchmarking Study
    Tamberg, Karl
    Bahsi, Hayretdin
    IEEE ACCESS, 2025, 13 : 29698 - 29717
  • [32] RTMS: A Smart Contract Vulnerability Detection Method Based on Feature Fusion and Vulnerability Correlations
    Gao, Gaimei
    Li, Zilu
    Jin, Lizhong
    Liu, Chunxia
    Li, Junji
    Meng, Xiangqi
    ELECTRONICS, 2025, 14 (04):
  • [33] Large language models based vulnerability detection: How does it enhance performance?
    Xuan, Cho Do
    Quang, Dat Bui
    Quang, Vinh Dang
    INTERNATIONAL JOURNAL OF INFORMATION SECURITY, 2025, 24 (01)
  • [34] Enhanced automated code vulnerability repair using large language models
    de-Fitero-Dominguez, David
    Garcia-Lopez, Eva
    Garcia-Cabot, Antonio
    Martinez-Herraiz, Jose-Javier
    ENGINEERING APPLICATIONS OF ARTIFICIAL INTELLIGENCE, 2024, 138
  • [35] Enhancing BERT-Based Language Model for Multi-label Vulnerability Detection of Smart Contract in Blockchain
    Tong, Van
    Dao, Cuong
    Tran, Hai-Anh
    Tran, Truong X.
    Souihi, Sami
    JOURNAL OF NETWORK AND SYSTEMS MANAGEMENT, 2024, 32 (03)
  • [36] An integrated deep learning model for Ethereum smart contract vulnerability detection
    Jain, Vikas Kumar
    Tripathi, Meenakshi
    INTERNATIONAL JOURNAL OF INFORMATION SECURITY, 2024, 23 (01) : 557 - 575
  • [37] Vulnerability Detection for Smart Contract via Backward Bayesian Active Learning
    Zhang, Jiale
    Tu, Liangqiong
    Cai, Jie
    Su, Xiaobing
    Li, Bin
    Chen, Weitong
    Wang, Yu
    APPLIED CRYPTOGRAPHY AND NETWORK SECURITY WORKSHOPS, ACNS 2022, 2022, 13285 : 66 - 83
  • [38] Smart Contract Vulnerability Detection Based on Multi-Scale Encoders
    Guo, Junjun
    Lu, Long
    Li, Jingkui
    ELECTRONICS, 2024, 13 (03)
  • [39] Smart contract: a survey towards extortionate vulnerability detection and security enhancement
    Porkodi, S.
    Kesavaraja, D.
    WIRELESS NETWORKS, 2024, 30 (03) : 1285 - 1304
  • [40] SmartGuard: An LLM-enhanced framework for smart contract vulnerability detection
    Ding, Hao
    Liu, Yizhou
    Piao, Xuefeng
    Song, Huihui
    Ji, Zhenzhou
    EXPERT SYSTEMS WITH APPLICATIONS, 2025, 269