追踪恶魔足迹:面向价格操纵攻击的实时检测
Following Devils' Footprint: Towards Real-time Detection of Price Manipulation Attacks
AI总结:
本文提出SMARTCAT方法,通过分析攻击合约字节码并构建代币流图,在攻击前阶段实时检测DeFi价格操纵攻击,在以太坊和币安智能链上实现91.6%召回率和近100%精确率,并发现616个真实攻击合约。
摘要:
价格操纵攻击是去中心化金融(DeFi)应用中臭名昭著的威胁之一,攻击者能够以严重偏离市场的价格交换代币。现有工作通常依赖被动式方法,在攻击发生之后才识别此类攻击,例如在攻击后阶段检测攻击交易,无法及时缓解或预防价格操纵攻击。从攻击者的角度看,他们通常需要在攻击前阶段部署攻击合约。因此,如果我们能够以主动方式识别这些攻击合约,就可以发出警报并缓解威胁。基于这一核心思想,本文我们将注意力从受害者转移到攻击者身上。具体来说,我们提出SMARTCAT,一种在攻击前阶段主动识别价格操纵攻击的新方法。在通用性方面,它对字节码进行分析,不需要任何源代码和交易数据。在准确性方面,它将函数调用之间的控制流和数据流依赖关系刻画为代币流图。在可扩展性方面,它过滤出可疑路径,并在必要时对可疑路径进行合约间分析。由此,SMARTCAT能够在攻击合约一旦部署上链后实时精确定位攻击。评估结果表明,SMARTCAT显著优于现有基线方法,召回率达到91.6%,精确率接近100%。此外,SMARTCAT还在真实环境中发现了616个攻击合约,涉及925万美元的财务损失,而其中仅有19起被公开报告。将SMARTCAT作为实时检测器应用于以太坊和币安智能链后,它在相应部署后平均99秒内发出了14次警报。这些攻击已经造成了64.1万美元的财务损失,其中7起仍在等待合适的发动时机。
英文摘要:
Price manipulation attack is one of the notorious threats in decentralized finance (DeFi) applications, which allows attackers to exchange tokens at an extensively deviated price from the market. Existing efforts usually rely on reactive methods to identify such kind of attacks after they have happened, e.g., detecting attack transactions in the post-attack stage, which cannot mitigate or prevent price manipulation attacks timely. From the perspective of attackers, they usually need to deploy attack contracts in the pre-attack stage. Thus, if we can identify these attack contracts in a proactive manner, we can raise alarms and mitigate the threats. With the core idea in mind, in this work, we shift our attention from the victims to the attackers. Specifically, we propose SMARTCAT, a novel approach for identifying price manipulation attacks in the pre-attack stage proactively. For generality, it conducts analysis on bytecode and does not require any source code and transaction data. For accuracy, it depicts the control- and data-flow dependency relationships among function calls into a token flow graph. For scalability, it filters out those suspicious paths, in which it conducts inter-contract analysis as necessary. To this end, SMARTCAT can pinpoint attacks in real time once they have been deployed on a chain. The evaluation results illustrate that SMARTCAT significantly outperforms existing baselines with 91.6% recall and ~100% precision. Moreover, SMARTCAT also uncovers 616 attack contracts in-the-wild, accounting for \$9.25M financial losses, with only 19 cases publicly reported. By applying SMARTCAT as a real-time detector in Ethereum and Binance Smart Chain, it has raised 14 alarms 99 seconds after the corresponding deployment on average. These attacks have already led to $641K financial losses, and seven of them are still waiting for their ripe time.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。