FlashSyn: Flash Loan Attack Synthesis via Counter Example Driven Approximation

06/21/2022
by   Zhiyang Chen, et al.
0

In decentralized finance (DeFi) ecosystem, lenders can offer flash loans to borrowers, i.e., loans that are only valid within a blockchain transaction and must be repaid with some fees by the end of that transaction. Unlike normal loans, flash loans allow borrowers to borrow a large amount of assets without upfront collaterals deposits. Malicious adversaries can use flash loans to gather large amount of assets to launch costly exploitations targeting DeFi protocols. In this paper, we introduce a new framework for automated synthesis of adversarial contracts 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 new counterexamples-driven approximation refinement technique. We implement our framework in a tool called FlashSyn. We evaluate FlashSyn on 12 DeFi protocols that were victims to flash loan attacks and DeFi protocols from Damn Vulnerable DeFi challenges. FlashSyn automatically synthesizes an adversarial attack for each one of them.

READ FULL TEXT

page 1

page 28

research
03/08/2020

Attacking the DeFi Ecosystem with Flash Loans for Fun and Profit

Credit allows a lender to loan out surplus capital to a borrower. In the...
research
02/18/2022

Automated Attack Synthesis by Extracting Finite State Machines from Protocol Specification Documents

Automated attack discovery techniques, such as attacker synthesis or mod...
research
02/19/2020

The Decentralized Financial Crisis: Attacking DeFi

The Global Financial Crisis of 2008, caused by excessive financial risk,...
research
04/02/2020

Automated Attacker Synthesis for Distributed Protocols

Distributed protocols should be robust to both benign malfunction (e.g. ...
research
02/09/2021

Synthesis of Winning Attacks on Communication Protocols using Supervisory Control Theory

There is an increasing need to study the vulnerability of communication ...
research
02/08/2023

Short Squeeze in DeFi Lending Market: Decentralization in Jeopardy?

Anxiety levels in the AAVE community spiked in November 2022 as Avi Eise...
research
08/27/2022

SoK: Decentralized Finance (DeFi) Incidents

Within just four years, the blockchain-based Decentralized Finance (DeFi...

Please sign up or login with your details

Forgot password? Click here to reset