论文标题

Flashsyn:Flash Loan攻击通过反示例驱动近似

FlashSyn: Flash Loan Attack Synthesis via Counter Example Driven Approximation

论文作者

Chen, Zhiyang, Beillahi, Sidi Mohamed, Long, Fan

论文摘要

在分散的财务(DEFI)中,贷方可以向借款人提供闪光贷款,即仅在区块链交易中有效的贷款,并且必须在该交易结束时偿还费用。与普通贷款不同,Flash贷款允许借款人在没有前期抵押品的情况下借入大量资产。恶意对手使用Flash贷款来收集大型资产来利用弱势违规协议。在本文中,我们引入了一个新的框架,用于自动合成对抗交易,该框架使用Flash贷款利用Defi协议。为了绕过DEFI协议的复杂性,我们提出了一项新技术,以使用数值方法(多项式线性回归和最近的邻居插值)近似Defi协议功能行为。然后,我们使用DEFI协议的近似函数构建优化查询,以找到由具有最佳参数的函数调用序列构成的对抗性攻击,从而赋予最大利润。为了提高近似值的准确性,我们提出了一种新型的反例近似细化技术。我们在名为Flashsyn的工具中实现框架。我们评估了16种Fefi协议的Flashsyn,这些协议是Flash Loan攻击的受害者,以及该死的脆弱挑战中的2种DEFI协议。 Flashsyn自动合成了18个基准中的16个对抗性攻击。在这16个成功的案例中,Flashsyn确定了比历史黑客在3例中使用的攻击媒介的利润更高,并且在10个情况下还发现了多个不同的攻击媒介,这表明了其在发现可能的闪光贷款攻击方面的有效性。

In decentralized finance (DeFi), lenders can offer flash loans to borrowers, i.e., loans that are only valid within a blockchain transaction and must be repaid with fees by the end of that transaction. Unlike normal loans, flash loans allow borrowers to borrow large assets without upfront collaterals deposits. Malicious adversaries use flash loans to gather large assets to exploit vulnerable DeFi protocols. In this paper, we introduce a new framework for automated synthesis of adversarial transactions that exploit DeFi protocols using flash loans. To bypass the complexity of a DeFi protocol, we propose a new technique to approximate the DeFi protocol functional behaviors using numerical methods (polynomial linear regression and nearest-neighbor interpolation). We then construct an optimization query using the approximated functions of the DeFi protocol to find an adversarial attack constituted of a sequence of functions invocations with optimal parameters that gives the maximum profit. To improve the accuracy of the approximation, we propose a novel counterexample driven approximation refinement technique. We implement our framework in a tool named FlashSyn. We evaluate FlashSyn on 16 DeFi protocols that were victims to flash loan attacks and 2 DeFi protocols from Damn Vulnerable DeFi challenges. FlashSyn automatically synthesizes an adversarial attack for 16 of the 18 benchmarks. Among the 16 successful cases, FlashSyn identifies attack vectors yielding higher profits than those employed by historical hackers in 3 cases, and also discovers multiple distinct attack vectors in 10 cases, demonstrating its effectiveness in finding possible flash loan attacks.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源