一句话:提出 PromFuzz,用双智能体 LLM 定位可疑函数、生成不变式检查器并做面向缺陷的模糊测试,高效检测智能合约功能缺陷。
智能合约中的功能缺陷常可被利用并造成巨额资金损失,而现有工具难以检测其中 80% 以上的可触发缺陷。其核心难点在于高层业务逻辑与低层合约实现之间存在鸿沟,且需要依据不同缺陷特征自动生成有效的检测 oracle。本文提出 PromFuzz:首先设计 LLM 驱动的双智能体提示工程分析框架,定位可能易受攻击的函数;随后采用双阶段耦合方法,基于从可疑函数中抽取的逻辑信息生成不变式检查器;最后实现面向缺陷的模糊测试引擎,将高层业务模型的逻辑信息映射到低层合约实现,对目标函数执行定向模糊测试。作者在 5 个 ground-truth 数据集上从 4 个维度评估,与多种 SOTA 方法相比,功能缺陷检测达到 86.96% 召回率和 93.02% F1 值,两项指标至少提升 50%。在 10 个真实 DeFi 项目中检测出 30 个零日缺陷,其中 24 个已获 CVE 编号,保护了价值 182 亿美元的资产。
Smart contracts are fundamental pillars of the blockchain, playing a crucial role in facilitating various business transactions. However, these smart contracts are vulnerable to exploitable bugs that can lead to substantial monetary losses. A recent study reveals that over 80% of these exploitable bugs, which are primarily functional bugs, can evade the detection of current tools. Automatically identifying functional bugs in smart contracts presents challenges from multiple perspectives. The primary issue is the significant gap between understanding the high-level logic of the business model and checking the low-level implementations in smart contracts. Furthermore, identifying deeply rooted functional bugs in smart contracts requires the automated generation of effective detection oracles based on various bug features.To address these challenges, we design and implement PromFuzz, an automated and scalable system to detect functional bugs in smart contracts. In PromFuzz, we first propose a novel Large Language Model (LLM)-driven analysis framework, which leverages a dual-agent prompt engineering strategy to pinpoint potentially vulnerable functions for further scrutiny. We then implement a dual-stage coupling approach, which focuses on generating invariant checkers that leverage logic information extracted from potentially vulnerable functions. Finally, we design a bug-oriented fuzzing engine, which maps the logical information from the high-level business model to the low-level smart contract implementations, and performs the bug-oriented fuzzing on targeted functions. We evaluate PromFuzz from 4 perspectives on 5 ground-truth datasets and compare it with multiple state-of-the-art methods. The results show that PromFuzz achieves 86.96% recall and 93.02% F1-score in detecting functional bugs, marking at least a 50% improvement in both metrics over state-of-the-art methods. Moreover, we perform an in-depth analysis on 10 real-world DeFi projects and detect 30 zero-day bugs. Our further case studies, the risky first deposit bug and the AMM price oracle manipulation bug on real-world DeFi projects, demonstrate the serious risks of the exploitable functional bugs in smart contracts. Up to now, 24 zero-day bugs have been assigned CVE IDs. Our discoveries have safeguarded assets totaling $18.2 billion from potential monetary losses.
DOI 原文 ·
@inproceedings{paperbot9499,
title = {PromFuzz: Leveraging LLM-Driven and Bug-Oriented Composite Analysis for Detecting Functional Bugs in Smart Contracts},
author = {Xingshuang Lin and Qinge Xie and Binbin Zhao and Yuan Tian and Saman Zonouz and Na Ruan and Jiliang Li and Raheem Beyah and Shouling Ji},
booktitle = {ASE},
year = {2025},
doi = {10.1109/ase63991.2025.00091}
}