Curriculum·Graduate·G202

Vulnerability Classes a User Must Understand

Cream Finance, 27 October 2021, its third major exploit of the year, for about 130 million dollars. The attacker flash-borrowed DAI from Maker, minted a large amount of the yUSD share token, then transferred Yearn Curve tokens straight into the vault so that the vault's reported price per share doubled.

Taught in G202-01 ›Source ↗

Start with lesson 14 lessons · about 2 hours · free account to read in full

Lesson 1 opens on

Cream Finance, 27 October 2021

In its third major exploit of 2021, after the Iron Bank in February and an AMP flash-loan attack in August, Cream Finance was drained of about 130 million dollars. The attacker flash-borrowed 500 million DAI from Maker, used it to mint a large amount of the yUSD share token, then transferred Yearn Curve tokens directly into the yUSD vault. The vault's price per share is assets divided by shares, so a donation of assets with no new shares raised the price per share; Cream priced yUSD from that figure, so its oracle reported yUSD at roughly two dollars instead of one.

The lessons

  1. G202-01Oracle and price manipulationExplain how a protocol that reads a manipulable price treats a temporary number as a permanent truthabout 30 min · opens on Cream Finance, 27 October 2021
  2. G202-02The missing access checkExplain what an access-control check is and what happens when a privileged function has noneabout 30 min · opens on Poly Network, 10 August 2021
  3. G202-03Reentrancy, and the order of operationsExplain reentrancy as a contract being called again before it finishes updating its own stateabout 31 min · opens on The DAO, 17 June 2016
  4. G202-04Economic and governance attacksDistinguish an economic attack, where the code works and the incentives are exploited, from a code bugabout 30 min · opens on Beanstalk Farms, 17 April 2022