Skip to main content
QUICK REVIEW

[논문 리뷰] When ChatGPT Meets Smart Contract Vulnerability Detection: How Far Are We?

Chong Chen, Jianzhong Su|arXiv (Cornell University)|2023. 09. 11.
Blockchain Technology Applications and Security인용 수 5
한 줄 요약

이 논문은 SmartBugs 데이터셋을 사용하여 ChatGPT의 스마트 계약 취약점 탐지 효과성을 평가하며, 특히 특정 취약점 유형에서 높은 재현율과 낮은 정밀도를 보이며, 거짓 경고의 네 가지 근본 원인을 규명한다. 또한 ChatGPT를 11개의 최신 기술(SOTA) 도구와 비교하여 일곱 가지 취약점 유형 중 네 가지에서 뛰어난 성능을 보였지만, 전반적인 강건성과 코드 길이 처리 능력에 한계가 있음을 시사한다.

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, 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.

연구 동기 및 목표

  • 스마트 계약 취약점의 다양한 유형에 걸쳐 ChatGPT의 탐지 효과성을 평가하는 것.
  • ChatGPT가 취약점 탐지 과정에서 생성하는 거짓 경고의 근본 원인을 규명하고 분류하는 것.
  • ChatGPT의 성능을 11개의 최신 스마트 계약 취약점 탐지 도구와 비교하는 것.
  • 이 분야에서 ChatGPT의 한계, 특히 응답의 불확실성과 코드 길이 제약에 대해 분석하는 것.
  • 블록체인 보안 분야에서 LLMs(예: ChatGPT)를 실용적으로 활용할 수 있는지의 가능성과 향후 개선 필요성에 대한 통찰을 제공하는 것.

제안 방법

  • 연구는 DASP10에서 정의한 아홉 가지 취약점 유형으로 구성된 142개의 취약한 스마트 계약을 포함하는 널리 사용되는 SmartBugs-수집 데이터셋을 사용한다.
  • ChatGPT(GPT-3.5 및 GPT-4)가 아홉 가지 취약점 유형을 모두 탐지하도록 지시하는 표준화된 프롬프트를 설계한다.
  • 탐지 효과성을 정량화하기 위해 표준 지표인 정밀도, 재현율, F1-스코어를 사용하여 성능을 평가한다.
  • 거짓 경고는 네 가지 유형으로 체계적으로 분석하고 분류한다: 보호 메커니즘 편향, 개발 의도 편향, 주석으로 인한 간섭, 사라진 코드로 인한 간섭.
  • 동일한 데이터셋을 기반으로 11개의 SOTA 도구(예: Mythril, Confuzzius)와의 비교 평가를 수행하여 성능을 벤치마킹한다.
  • 분석 과정에서 ChatGPT의 한계, 특히 응답의 불안정성과 입력 코드 길이 제약에 대해도 고려한다.

실험 결과

연구 질문

  • RQ1RQ1: ChatGPT는 스마트 계약의 취약점을 탐지하는 데 얼마나 효과적인가? 그리고 다양한 취약점 유형에 따라 성능이 어떻게 달라지는가?
  • RQ2RQ2: ChatGPT의 탐지 성능는 다른 최신 스마트 계약 취약점 탐지 도구와 비교해 볼 때 어떻게 되는가?
  • RQ3RQ3: ChatGPT가 스마트 계약 취약점 탐지 과정에서 생성하는 거짓 경고의 근본 원인은 무엇인가?
  • RQ4RQ4: 이 맥락에서 ChatGPT의 주요 한계는 무엇인가? 특히 강건성과 입력 길이 제약 측면에서.

주요 결과

  • GPT-3.5의 재현율은 51.4%이며, GPT-4는 88.2%로 실제 취약점을 식별하는 데 강력한 능력을 보였다.
  • 그러나 정밀도는 낮아 GPT-3.5가 19.7%, GPT-4가 22.6%에 그쳐 거짓 경고 비율이 높았다.
  • Short Address Attack 유형에서는 GPT-3.5와 GPT-4 모두 성능이 열악했지만, Unchecked Return Values 유형에서는 양호한 성능을 보였다.
  • Front Running 및 Denial of Service 취약점 탐지에서 ChatGPT는 11개의 다른 도구보다 뛰어난 성능을 보였지만, F1-스코어는 각각 12.8%와 15.9%로 낮았다.
  • 거짓 경고의 주요 원인은 네 가지 범주로 나뉘었다: 보호 메커니즘 편향, 개발 의도 편향, 주석으로 인한 간섭, 사라진 코드로 인한 간섭.
  • ChatGPT는 평가된 도구 중 81.8%보다 더 높은 탐지 실패 비율을 보였으며, 강건성과 긴 코드 입력 처리 능력에 한계를 지닌다.

더 나은 연구,지금 바로 시작하세요

논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.