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

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Wang, Yishun, Li, Wenkai, Li, Xiaoqi, Li, Zongwei, Xie, Lei, Zhang, Yuqing
Format: Preprint
Veröffentlicht: 2026
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866917377013186560
author Wang, Yishun
Li, Wenkai
Li, Xiaoqi
Li, Zongwei
Xie, Lei
Zhang, Yuqing
author_facet Wang, Yishun
Li, Wenkai
Li, Xiaoqi
Li, Zongwei
Xie, Lei
Zhang, Yuqing
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2604_00657
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle LibScan: Smart Contract Library Misuse Detection with Iterative Feedback and Static Verification
Wang, Yishun
Li, Wenkai
Li, Xiaoqi
Li, Zongwei
Xie, Lei
Zhang, Yuqing
Software Engineering
Cryptography and Security
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.
title LibScan: Smart Contract Library Misuse Detection with Iterative Feedback and Static Verification
topic Software Engineering
Cryptography and Security
url https://arxiv.org/abs/2604.00657