Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
38 tokens/sec
GPT-4o
59 tokens/sec
Gemini 2.5 Pro Pro
41 tokens/sec
o3 Pro
7 tokens/sec
GPT-4.1 Pro
50 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

When ChatGPT Meets Smart Contract Vulnerability Detection: How Far Are We? (2309.05520v4)

Published 11 Sep 2023 in cs.SE

Abstract: With the development of blockchain technology, smart contracts have become an important component of blockchain applications. Despite their crucial role, the development of smart contracts may introduce vulnerabilities and potentially lead to severe consequences, such as financial losses. Meanwhile, LLMs, represented by ChatGPT, have gained great attentions, showcasing great capabilities in code analysis tasks. In this paper, we presented an empirical study to investigate the performance of ChatGPT in identifying smart contract vulnerabilities. Initially, we evaluated ChatGPT's effectiveness using a publicly available smart contract dataset. Our findings discover that while ChatGPT achieves a high recall rate, its precision in pinpointing smart contract vulnerabilities is limited. Furthermore, ChatGPT's performance varies when detecting different vulnerability types. We delved into the root causes for the false positives generated by ChatGPT, and categorized them into four groups. Second, by comparing ChatGPT with other state-of-the-art smart contract vulnerability detection tools, we found that ChatGPT's F-score is lower than others for 3 out of the 7 vulnerabilities. In the case of the remaining 4 vulnerabilities, ChatGPT exhibits a slight advantage over these tools. Finally, we analyzed the limitation of ChatGPT in smart contract vulnerability detection, revealing that the robustness of ChatGPT in this field needs to be improved from two aspects: its uncertainty in answering questions; and the limited length of the detected code. In general, our research provides insights into the strengths and weaknesses of employing LLMs, specifically ChatGPT, for the detection of smart contract vulnerabilities.

User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (10)
  1. Chong Chen (122 papers)
  2. Jianzhong Su (10 papers)
  3. Jiachi Chen (45 papers)
  4. Yanlin Wang (76 papers)
  5. Tingting Bi (18 papers)
  6. Yanli Wang (43 papers)
  7. Xingwei Lin (7 papers)
  8. Ting Chen (148 papers)
  9. Zibin Zheng (194 papers)
  10. Jianxing Yu (18 papers)
Citations (40)