Toutes les vulnérabilités
CRITICALWeb3exploited in the wild

WEB3-INVERSE-2022

Web3 · Ethereum · Inverse Finance

Résumé

On 2 April 2022 Inverse Finance lost approximately $15.6 million on Ethereum when an attacker manipulated the INV price oracle feeding its Anchor money market. INV was priced by a Keep3r TWAP over the SushiSwap INV/ETH pair, but the oracle only folded a new price cumulative into the average when the elapsed time exceeded its 30-minute period, so shortly after a fresh update the oracle effectively returned the current manipulable spot price instead of a true time-weighted average. Using about 500 ETH of their own funds (no flash loan), the attacker bought INV on SushiSwap and routed ETH through Curve and DOLA into more INV, draining the thin INV/ETH pool and spiking the reported INV price, then deposited the inflated INV as collateral and borrowed ETH, WBTC, DOLA and YFI far exceeding its real value. The root cause was a TWAP whose update window let a single-block spot manipulation pass through as the reported price.

Comment l’éviter dans votre code

  • Ensure TWAP oracles actually average over a sufficiently long window; never let an update-period gate fall back to spot price
  • Reject oracle reads when too little time has elapsed since the last cumulative update instead of returning the spot value
  • Avoid TWAPs sourced from low-liquidity pairs; thin pools are cheap to skew even without a flash loan
  • Cross-check the collateral oracle against an independent feed (Chainlink) and reject prices outside deviation bounds
  • Stress-test manipulation cost against an attacker spending only their own capital, not just flash loans

Références

Vulnérabilités liées

Tout Web3 →