arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2510.21272cs.CRcs.SE
收藏

基于大语言模型的去中心化金融中价格操纵检测

LLM-Powered Detection of Price Manipulation in DeFi

The Hong Kong University of Science and Technology(香港科技大学);MegaETH;McGill University(麦吉尔大学);Nankai University(南开大学);Monash University(莫纳什大学);Southern University of Science and Technology(南方科技大学)

Lu Liu, Wuqi Zhang, Lili Wei, Hao Guan, Yongqiang Tian, Yepang Liu, Shing-Chi Cheung

AI总结:

本文提出PMDetector框架,结合静态分析与大语言模型推理,主动检测DeFi中的价格操纵漏洞,通过三阶段流程提升检测精度与召回率,实验表明其在效率和成本上优于现有方法。

摘要:

去中心化金融(DeFi)智能合约管理数十亿美元,使其成为攻击目标。价格操纵漏洞,通常通过闪贷发起,是破坏性攻击类型,造成重大经济损失。现有检测方法有限。反应式方法仅在攻击发生后分析,而主动静态分析工具依赖于刚性的预定义启发式方法,限制了适应性。两者都依赖于已知的攻击模式,无法识别新变种或理解复杂的经济逻辑。我们提出PMDetector,一种结合静态分析与大语言模型(LLM)推理的混合框架,以主动检测价格操纵漏洞。我们的方法使用形式化攻击模型和三阶段流程。首先,静态污点分析识别潜在易受攻击的代码路径。其次,两阶段LLM过程通过分析防御并过滤路径,然后模拟攻击以评估可利用性。最后,静态分析检查器验证LLM结果,保留高风险路径并生成全面的漏洞报告。为了评估其有效性,我们构建了一个包含73个真实世界漏洞和288个良性DeFi协议的数据集。结果表明,PMDetector在Gemini 2.5-flash上实现88%的精度和90%的召回率,显著优于现有静态分析和LLM方法。使用PMDetector审计漏洞仅需0.03美元和4.0秒(GPT-4.1),提供了比人工审计更高效且经济的替代方案。

英文摘要:

Decentralized Finance (DeFi) smart contracts manage billions of dollars, making them a prime target for exploits. Price manipulation vulnerabilities, often via flash loans, are a devastating class of attacks causing significant financial losses. Existing detection methods are limited. Reactive approaches analyze attacks only after they occur, while proactive static analysis tools rely on rigid, predefined heuristics, limiting adaptability. Both depend on known attack patterns, failing to identify novel variants or comprehend complex economic logic. We propose PMDetector, a hybrid framework combining static analysis with Large Language Model (LLM)-based reasoning to proactively detect price manipulation vulnerabilities. Our approach uses a formal attack model and a three-stage pipeline. First, static taint analysis identifies potentially vulnerable code paths. Second, a two-stage LLM process filters paths by analyzing defenses and then simulates attacks to evaluate exploitability. Finally, a static analysis checker validates LLM results, retaining only high-risk paths and generating comprehensive vulnerability reports. To evaluate its effectiveness, we built a dataset of 73 real-world vulnerable and 288 benign DeFi protocols. Results show PMDetector achieves 88% precision and 90% recall with Gemini 2.5-flash, significantly outperforming state-of-the-art static analysis and LLM-based approaches. Auditing a vulnerability with PMDetector costs just $0.03 and takes 4.0 seconds with GPT-4.1, offering an efficient and cost-effective alternative to manual audits.

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

↑