当逻辑遇上魔法:大语言模型破解智能合约漏洞
Logic Meets Magic: LLMs Cracking Smart Contract Vulnerabilities
AI总结:
针对现有基于大语言模型的智能合约漏洞检测误报率高的问题,本文基于Solidity v0.8版本和五款最新LLM开展评估,发现合理提示词可降60%以上误报率,同时揭示了新版本部分漏洞召回率骤降的原因。
摘要:
智能合约漏洞已在区块链应用中造成了重大经济损失。大语言模型(LLM)为解决这项耗时的任务提供了新的可能。然而,当前最先进的基于LLM的检测方案往往受困于较高的误报率。\n本文从两个关键方向拓展了现有研究的边界。第一,我们的评估基于Solidity v0.8版本开展,与此前聚焦于旧版本(v0.4)的研究相比,提供了最新的研究洞见。第二,我们采用了来自不同公司的最新五款LLM模型,确保全面覆盖该领域最先进的能力。\n我们开展了一系列严格的评估。实验表明,设计合理的提示词可将误报率降低60%以上。出人意料的是,我们还发现,与早期版本(即v0.4)相比,Solidity v0.8中部分特定漏洞的检测召回率已降至仅13%。进一步分析揭示了这一下降的根本原因:LLM在检测过程中依赖识别新引入的库和框架中的变化。
英文摘要:
Smart contract vulnerabilities caused significant economic losses in blockchain applications. Large Language Models (LLMs) provide new possibilities for addressing this time-consuming task. However, state-of-the-art LLM-based detection solutions are often plagued by high false-positive rates. In this paper, we push the boundaries of existing research in two key ways. First, our evaluation is based on Solidity v0.8, offering the most up-to-date insights compared to prior studies that focus on older versions (v0.4). Second, we leverage the latest five LLM models (across companies), ensuring comprehensive coverage across the most advanced capabilities in the field. We conducted a series of rigorous evaluations. Our experiments demonstrate that a well-designed prompt can reduce the false-positive rate by over 60%. Surprisingly, we also discovered that the recall rate for detecting some specific vulnerabilities in Solidity v0.8 has dropped to just 13% compared to earlier versions (i.e., v0.4). Further analysis reveals the root cause of this decline: the reliance of LLMs on identifying changes in newly introduced libraries and frameworks during detection.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。