When ChatGPT Meets Smart Contract Vulnerability Detection: How Far Are We?

09/11/2023
by   Chong Chen, et al.
0

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, large language models, 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 large language models, specifically ChatGPT, for the detection of smart contract vulnerabilities.

READ FULL TEXT

page 7

page 17

page 20

research
07/29/2020

EOSFuzzer: Fuzzing EOSIO Smart Contracts for Vulnerability Detection

EOSIO is one typical public blockchain platform. It is scalable in terms...
research
03/25/2023

OpenSCV: An Open Hierarchical Taxonomy for Smart Contract Vulnerabilities

Smart contracts are nowadays at the core of most blockchain systems, as ...
research
08/20/2023

To Healthier Ethereum: A Comprehensive and Iterative Smart Contract Weakness Enumeration

With the increasing popularity of cryptocurrencies and blockchain techno...
research
12/10/2019

Doublade: Unknown Vulnerability Detection in Smart Contracts Via Abstract Signature Matching and Refined Detection Rules

With the prosperity of smart contracts and the blockchain technology, va...
research
05/15/2023

DAppSCAN: Building Large-Scale Datasets for Smart Contract Weaknesses in DApp Projects

The Smart Contract Weakness Classification Registry (SWC Registry) is a ...
research
09/14/2023

Two Timin': Repairing Smart Contracts With A Two-Layered Approach

Due to the modern relevance of blockchain technology, smart contracts pr...
research
06/21/2023

Do you still need a manual smart contract audit?

We investigate the feasibility of employing large language models (LLMs)...

Please sign up or login with your details

Forgot password? Click here to reset