用大模型自动发现去中心化金融中的价格预言机篡改漏洞。
AiRacleX: Automated Detection of Price Oracle Manipulations via LLM-Driven Knowledge Mining and Prompt Generation
- 通过多阶段大模型提取领域知识并生成推理提示,自动化检测漏洞。
- 在60个真实漏洞上召回率提升2.58倍,优于现有工具GPTScan。
- 支持开源模型替代商业模型,更适合注重隐私的开发者。
去中心化金融(DeFi)应用依赖准确的价格预言机保障交易安全,但预言机极易遭受操纵,攻击者可利用智能合约漏洞实现资产估值欺诈与非法获利。传统检测依赖专家手动分析,效率低下。本文提出一种新型大模型驱动框架AiRacleX,通过不同大模型协同工作,首先从顶级学术论文中提取预言机漏洞的精准知识,再生成上下文感知的链式思维提示,最终由第三模型识别智能合约中的操纵模式。我们在2021至2023年间46个真实项目的60个已知漏洞上验证该框架,最佳组合(Haiku-Haiku-4o-mini)相比现有工具GPTScan,召回率从0.259提升至0.667,提升2.58倍,同时保持相近精度。此外,框架证明可用开源模型替代商用模型,增强开发者隐私与安全性。
原文摘要 · Abstract (English)
Decentralized finance (DeFi) applications depend on accurate price oracles to ensure secure transactions, yet these oracles are highly vulnerable to manipulation, enabling attackers to exploit smart contract vulnerabilities for unfair asset valuation and financial gain. Detecting such manipulations traditionally relies on the manual effort of experienced experts, presenting significant challenges. In this paper, we propose a novel LLM-driven framework that automates the detection of price oracle manipulations by leveraging the complementary strengths of different LLM models (LLMs). Our approach begins with domain-specific knowledge extraction, where an LLM model synthesizes precise insights about price oracle vulnerabilities from top-tier academic papers, eliminating the need for profound expertise from developers or auditors. This knowledge forms the foundation for a second LLM model to generate structured, context-aware chain of thought prompts, which guide a third LLM model in accurately identifying manipulation patterns in smart contracts. We validate the effectiveness of framework through experiments on 60 known vulnerabilities from 46 real-world DeFi attacks or projects spanning 2021 to 2023. The best performing combination of LLMs (Haiku-Haiku-4o-mini) identified by AiRacleX demonstrate a 2.58-times improvement in recall (0.667 vs 0.259) compared to the state-of-the-art tool GPTScan, while maintaining comparable precision. Furthermore, our framework demonstrates the feasibility of replacing commercial models with open-source alternatives, enhancing privacy and security for developers.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。