Toutes les vulnérabilités
CRITICALWeb3exploited in the wild

WEB3-BZX-2020

Web3 · Ethereum · bZx Protocol

Résumé

In February 2020 bZx suffered two flash-loan price-manipulation attacks days apart, losing roughly $350,000 then roughly $650,000 (about $1M total) on Ethereum, the first widely studied flash-loan oracle attacks. In the first attack on 15 February the attacker flash-borrowed 10,000 ETH, opened a leveraged WBTC position through bZx's Fulcrum that internally swapped a large amount of ETH via Kyber into a thin Uniswap WBTC pool, spiking the WBTC spot price bZx read as its oracle, while a buggy collateral check skipped shouldLiquidate() and let the under-collateralized position stand. In the second attack on 18 February the attacker flash-borrowed ETH and pushed sUSD up to about $2 by buying it across Kyber reserves, then posted that sUSD at its manipulated spot value as collateral on bZx to borrow far more ETH than the position was worth. The root cause was pricing collateral from a single DEX's manipulable spot rate within one atomic transaction rather than a manipulation-resistant feed.

Comment l’éviter dans votre code

  • Never price collateral from a single DEX's spot rate; use a manipulation-resistant oracle (Chainlink or a long-window TWAP)
  • Treat any value read inside a transaction that also moves the pool as attacker-controlled; reject flash-loan-atomic reads
  • Enforce collateralization and liquidation checks on every borrow path; never let a conditional branch skip shouldLiquidate()
  • Validate trades against expected slippage and reject swaps that move price beyond tight deviation bounds
  • Cross-check prices against a second independent source before opening or borrowing against a position

Références

Vulnérabilités liées

Tout Web3 →