arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.00657cs.SEcs.CR
收藏

LibScan: 利用迭代反馈和静态验证的智能合约库误用检测

LibScan: Smart Contract Library Misuse Detection with Iterative Feedback and Static Verification

Hainan University(海南大学);University of Chinese Academy of Sciences(中国科学院大学)

Yishun Wang, Wenkai Li, Xiaoqi Li, Zongwei Li, Lei Xie, Yuqing Zhang

AI总结:

本文提出LibScan框架,结合大语言模型和规则分析,识别智能合约中八类库误用,通过迭代修正和知识库提升检测准确率至85.15%。

摘要:

智能合约是运行在区块链网络上的自我执行程序,开发者常依赖第三方代码库提高效率和安全性。然而,不当使用这些库可能引入隐藏漏洞,导致重大财务损失。现有工具难以检测此类误用,因为需要理解开发者意图而非单纯扫描已知模式。本文提出LibScan框架,结合大语言模型的语义推理与规则代码分析,识别智能合约中八类库误用。为提高检测可靠性,框架采用迭代自我修正机制,结合大规模实证研究构建的知识库。实验表明,LibScan在662个真实智能合约上达到85.15%的检测准确率,优于现有工具16个百分点以上。消融实验进一步证实,结合两种分析方法比单独使用效果更佳。

英文摘要:

Smart contracts are self-executing programs that manage financial transactions on blockchain networks. Developers commonly rely on third-party code libraries to improve both efficiency and security. However, improper use of these libraries can introduce hidden vulnerabilities that are difficult to detect, leading to significant financial losses. Existing automated tools struggle to identify such misuse because it often requires understanding the developer's intent rather than simply scanning for known code patterns. This paper presents LibScan, an automated detection framework that combines large language model (LLM)-based semantic reasoning with rule-based code analysis, identifying eight distinct categories of library misuse in smart contracts. To improve detection reliability, the framework incorporates an iterative self-correction mechanism that refines its analysis across multiple rounds, alongside a structured knowledge base derived from large-scale empirical studies of real-world misuse cases. Experiments conducted on 662 real-world smart contracts demonstrate that LibScan achieves an overall detection accuracy of 85.15\%, outperforming existing tools by a margin of over 16 percentage points. Ablation experiments further confirm that combining both analysis approaches yields substantially better results than either method used independently.

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

↑