Soley:利用大语言模型识别并自动化检测以太坊智能合约中的逻辑漏洞
Soley: Identification and Automated Detection of Logic Vulnerabilities in Ethereum Smart Contracts Using Large Language Models
AI总结:
本研究针对以太坊智能合约逻辑漏洞问题,提出基于大语言模型的Soley自动化检测方法,识别出9种新型漏洞及对应缓解策略,检测性能优于现有基线方法。
摘要:
以太坊等现代区块链支持所谓智能合约的部署与执行,这类自主数字程序承载着价值不菲的加密货币。执行智能合约需要用户支付gas费用,该费用界定了合约的执行上限。智能合约中的逻辑漏洞可能导致经济损失,且往往是高影响力网络攻击的根本原因。我们的研究目标有三项:(1)对从GitHub代码变更中提取的真实世界智能合约中的逻辑漏洞开展实证研究;(2)提出Soley——一种利用大语言模型(LLMs)检测智能合约逻辑漏洞的自动化方法;(3)研究智能合约开发者在真实场景中修复这类漏洞所采用的缓解策略。我们从GitHub获取了智能合约及相关代码变更。为实现第一和第三项目标,我们采用开放式编码法对已有的逻辑漏洞进行定性研究,识别出这些漏洞及其缓解策略。针对第二项目标,我们提取了多种逻辑漏洞,应用预处理技术,实现并训练了所提出的Soley模型。我们评估了Soley及多种LLMs的性能,并将结果与逻辑漏洞检测任务的当前最优基线进行了对比。通过分析,我们识别出9种新型逻辑漏洞,用这些漏洞拓展了现有的漏洞分类体系。此外,我们还从真实场景中观察到的开发者修改内容里,提炼出若干种缓解策略。我们的Soley方法在自动识别逻辑漏洞方面优于现有方法。值得注意的是,LLMs在该任务中的效用无需大量特征工程即可显现。
英文摘要:
Modern blockchain, such as Ethereum, supports the deployment and execution of so-called smart contracts, autonomous digital programs with significant value of cryptocurrency. Executing smart contracts requires gas costs paid by users, which define the limits of the contract's execution. Logic vulnerabilities in smart contracts can lead to financial losses, and are often the root cause of high-impact cyberattacks. Our objective is threefold: (i) empirically investigate logic vulnerabilities in real-world smart contracts extracted from code changes on GitHub, (ii) introduce Soley, an automated method for detecting logic vulnerabilities in smart contracts, leveraging Large Language Models (LLMs), and (iii) examine mitigation strategies employed by smart contract developers to address these vulnerabilities in real-world scenarios. We obtained smart contracts and related code changes from GitHub. To address the first and third objectives, we qualitatively investigated available logic vulnerabilities using an open coding method. We identified these vulnerabilities and their mitigation strategies. For the second objective, we extracted various logic vulnerabilities, applied preprocessing techniques, and implemented and trained the proposed Soley model. We evaluated Soley along with the performance of various LLMs and compared the results with the state-of-the-art baseline on the task of logic vulnerability detection. From our analysis, we identified nine novel logic vulnerabilities, extending existing taxonomies with these vulnerabilities. Furthermore, we introduced several mitigation strategies extracted from observed developer modifications in real-world scenarios. Our Soley method outperforms existing methods in automatically identifying logic vulnerabilities. Interestingly, the efficacy of LLMs in this task was evident without requiring extensive feature engineering.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。