Euler Finance遭闪电贷攻击 损失近2亿美元

Euler Finance project suffered a flash loan attack, resulting in a loss of nearly 200 million USD.

On March 13, 2023, the Euler Finance project suffered a flash loan attack, resulting in a massive loss of approximately $197 million. The attacker exploited a vulnerability in the project's contract and completed the attack through multiple operations. Currently, the stolen funds remain in the attacker's account.

Euler Finance Vulnerability Analysis: How to Suffer a Flash Loan Attack, Losing 197 Million USD!

Attack Process Analysis

  1. The attacker first borrowed 30 million DAI through a flash loan from a lending platform and deployed two contracts: one borrowing contract and one liquidation contract.

  2. The attacker staked the borrowed 20 million DAI into the Euler Protocol contract and obtained 19.5 million eDAI.

  3. By utilizing the leverage feature of the Euler Protocol, the attacker borrowed 195.6 million eDAI and 200 million dDAI.

  4. The attacker used the remaining 10 million DAI to repay part of the debt, destroyed 10 million dDAI, and then borrowed again 195.6 million eDAI and 200 million dDAI.

  5. Key Steps: The attacker calls the donateToReserves function, donating 100 million eDAI, and then liquidates through the liquidate function, obtaining 310 million dDAI and 250 million eDAI.

  6. Finally, the attacker extracted 38.9 million DAI, repaid 30 million DAI in Flash Loans, and ultimately profited 8.87 million DAI.

Euler Finance Vulnerability Analysis: How to Suffer Flash Loan Attack, Loss of 197 Million USD!

Euler Finance Vulnerability Analysis: How to Suffer a flash loan attack, Losing 197 Million USD!

Euler Finance Vulnerability Analysis: How to Suffer a flash loan attack, Losing 197 Million USD!

Euler Finance Vulnerability Analysis: How to Suffer a flash loan attack, Losing 197 Million USD!

Euler Finance Vulnerability Analysis: How to Suffer a flash loan attack, Losing 197 Million USD!

Euler Finance Vulnerability Analysis: How to Suffer a flash loan attack, Losing 197 Million USD!

Euler Finance Vulnerability Analysis: How to Suffer a Flash Loan Attack, Losing 197 Million USD!

Euler Finance Vulnerability Analysis: How to Suffer from a flash loan attack, Losing 197 Million USD!

Euler Finance Vulnerability Analysis: How to Suffer a flash loan attack, Losing 197 Million USD!

Vulnerability Cause

The main reason for the success of the attack is the flaw in the donateToReserves function of the Euler Finance contract. Unlike other key functions, this function lacks the necessary liquidity check step (checkLiquidity). This check should ensure that the user's eToken quantity is greater than the dToken quantity to maintain the health of the contract.

Due to the lack of this critical check, attackers are able to place themselves in a liquidatable state through specific operations, and then exploit this to carry out the attack.

Security Recommendations

For similar lending projects, special attention should be paid to the following key points:

  1. The security of the capital repayment mechanism
  2. The comprehensiveness of liquidity detection
  3. The rigor of the debt liquidation process

Before a contract goes live, it is essential to conduct a comprehensive and professional security audit. This not only helps to identify potential vulnerabilities but also ensures the overall security and stability of the contract.

This incident once again emphasizes the importance of contract security in the decentralized finance sector. Project teams should always prioritize security to protect user assets and maintain the healthy development of the entire ecosystem.

Euler Finance Vulnerability Analysis: How to Suffer a flash loan attack, Losing 197 Million USD!

EUL1.59%
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • 7
  • Share
Comment
0/400
SeasonedInvestorvip
· 13h ago
Another contract has been drained.
View OriginalReply0
tx_pending_forevervip
· 08-05 16:20
Smart contracts are not smart at all.
View OriginalReply0
airdrop_whisperervip
· 08-05 16:19
Smart contracts are difficult to secure.
View OriginalReply0
GasFeeCriervip
· 08-05 16:19
Another Vulnerability Feast
View OriginalReply0
screenshot_gainsvip
· 08-05 16:11
Another vulnerability Wallet
View OriginalReply0
OnchainArchaeologistvip
· 08-05 16:11
There is another issue with the contract.
View OriginalReply0
probably_nothing_anonvip
· 08-05 15:59
Free riding is innocent, Satoshi rides.
View OriginalReply0
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate app
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)