Toutes les vulnérabilités
CRITICALWeb3exploited in the wild

WEB3-AKROPOLIS-2020

Web3 · Ethereum · Akropolis Delphi

Résumé

On 12 November 2020 the Akropolis Delphi savings product on Ethereum lost about 2,030,841 DAI, roughly $2 million, from its yCurve and sUSD pools. The SavingsModule deposit path did not validate that the supplied token was a registered pool token and had no reentrancy guard, while crediting deposits from the contract's token balance delta before and after the transfer. The attacker deployed a fake ERC-20 whose transferFrom contained a malicious hook; depositToProtocol() called IERC20(token).safeTransferFrom() on that attacker-controlled address, handing over control flow. The fake token re-entered deposit(), this time supplying real flash-loaned DAI and minting pool tokens for it; when control unwound to the outer deposit, the balance-delta calculation observed the same DAI increase and minted pool shares a second time, double-counting one real deposit. Funded by a dYdX flash loan, the attacker looped this across seventeen transactions, a reentrancy compounded by missing token-address validation.

Comment l’éviter dans votre code

  • Whitelist and validate the deposit token against registered pool assets before any transfer
  • Add a nonReentrant guard to deposit and every entrypoint that mints internal shares
  • Do not compute credited amounts from balance-delta when the token contract is untrusted or caller-supplied
  • Mint shares only after the transfer settles and finalize accounting before returning
  • Treat any external transferFrom on an arbitrary token address as an untrusted callback

Références

Vulnérabilités liées

Tout Web3 →