arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.26497cs.CRcs.SE
收藏

在LLM时代中的重入检测

Reentrancy Detection in the Age of LLMs

Ca’ Foscari University of Venice(威尼斯卡福斯卡里大学);University of Camerino(卡梅里诺大学)

Dalila Ressi, Alvise Spanò, Matteo Rizzo, Lorenzo Benetollo, Sabina Rossi

AI总结:

本文通过构建两个基准测试,评估了12种形式化方法工具、10种机器学习模型和9种大语言模型在检测Solidity 0.8+中的重入漏洞方面的性能,结果显示大语言模型在重入检测中表现优于传统工具。

摘要:

重入仍然是以太坊智能合约中最关键的漏洞类别之一,但广泛使用的检测工具和数据集仍反映过时的模式和过时的Solidity版本。本文从可靠性角度出发,评估了Solidity 0.8+中的重入检测,通过在两个方面测试最先进的静态分析工具和基于AI的技术。我们构建了两个人工验证的基准:一个包含432个现实世界合约的聚合基准,以及一个重入场景数据集(RSD)包含143个手工设计的最小工作示例,用于隔离和压力测试单独的重入模式。我们随后评估了12种基于形式化方法的工具、10种机器学习模型和9种大语言模型。在聚合基准上,传统工具和ML模型在零样本设置下达到最高0.87 F1,而最好的LLM达到0.96。在RSD上,大多数工具在多个场景中失败,最高表现达到0.76 F1,而最强的模型达到0.82。总体而言,我们的结果表明,领先的LLM在重入检测中优于大多数现有检测器,突显了当前重入分析工具在稳健性和可维护性方面的严重差距。

英文摘要:

Reentrancy remains one of the most critical classes of vulnerabilities in Ethereum smart contracts, yet widely used detection tools and datasets continue to reflect outdated patterns and obsolete Solidity versions. This paper adopts a dependability-oriented perspective on reentrancy detection in Solidity 0.8+, assessing how reliably state-of-the-art static analyzers and AI-based techniques operate on modern code by putting them to the test on two fronts. We construct two manually verified benchmarks: an Aggregated Benchmark of 432 real-world contracts, consolidated and relabeled from prior datasets, and a Reentrancy Scenarios Dataset (RSD) of \chadded{143} handcrafted minimal working examples designed to isolate and stress-test individual reentrancy patterns. We then evaluate 12 formal-methods-based tools, 10 machine-learning models, and 9 large language models. On the Aggregated Benchmark, traditional tools and ML models achieve up to 0.87 F1, while the best LLMs reach 0.96 in a zero-shot setting. On the RSD, most tools fail on multiple scenarios, the top performer achieving an F1 of 0.76, whereas the strongest model attains 0.82. Overall, our results indicate that leading LLMs outperform the majority of existing detectors, highlighting concerning gaps in the robustness and maintainability of current reentrancy-analysis tools.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑