All vulnerabilities
CRITICALWeb3exploited in the wild

WEB3-EULER-2023

Web3 · Ethereum · Euler Finance

Summary

On March 13, 2023 Euler Finance, an Ethereum DeFi lending protocol, was drained of roughly $197M across DAI, wBTC, stETH and USDC. The root cause was a missing health check in the donateToReserves function, which let a user transfer eTokens to the protocol's reserves without any solvency verification. Funded by a ~$30M Aave flash loan, the attacker used Euler's leveraged minting (up to ~19x) to build a position of roughly 410M eDAI against 390M dDAI, then called donateToReserves to push the account into bad debt (insolvency) on purpose. They then self-liquidated through a second address; Euler's soft-liquidation logic applied a steep discount that grew with account unhealthiness, paying the liquidator far more collateral than the outstanding debt, which produced the profit after the flash loan was repaid. The attacker, identifying as 'Jacob', subsequently returned essentially all of the stolen funds, with Euler confirming full recovery in early April 2023.

How to avoid it in your code

  • Run a health/solvency check on every balance-changing path, including donations and transfers out of positions.
  • Apply checks-effects-interactions and re-validate account health after each state mutation.
  • Cap or floor liquidation discounts so liquidators cannot be paid more than the debt plus reasonable incentive.
  • Add invariant tests asserting no operation can move a healthy account into bad debt atomically.
  • Treat flash-loaned, single-transaction leverage cycles as a tested adversarial scenario.

References

Related vulnerabilities

All Web3 →