Skip to content
Smart contracts Write-up Advanced

Hack Analysis Cream Finance Oct 2021

Cream Finance's hybrid oracle for yUSD could be manipulated by transferring Yearn 4-Curve tokens directly to the yUSD vault, inflating the reported price. The attacker used this to make their collateral appear worth billions, then borrowed all available liquidity, stealing about $130m.

immunefi.com

Published on immunefi.com

Cream Finance experienced a major exploit on October 27, 2021, resulting in a loss of $130m in available liquidity.

The author, on immunefi.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the yUSD price oracle relied on the vault's exchange rate, which could be inflated by directly transferring Yearn 4-Curve tokens to the vault, and the protocol allowed unlimited supply of yUSD as collateral.

Impact

The attacker could drain about $130m in available liquidity from Cream Finance.

What the attacker needed

Access to flash loans; knowledge of DeFi protocols; no special privileges

How it was found

  1. Flash mint $500m DAI from MakerDAO
  2. Deposit DAI into Yearn 4-Curve pool
  3. Deposit Yearn 4-Curve into Yearn yUSD vault
  4. Deposit yUSD into Cream yUSD market
  5. Borrow over 500,000 Ether from AAVE v2
  6. Deposit Ether from another smart contract into Cream eth market — Account 2

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Cream Finance is a lending service where people deposit tokens as collateral and borrow other tokens against them. It uses an oracle to decide how much each token is worth. The oracle for one token (yUSD) could be tricked by sending extra tokens directly to a vault, making the system believe the attacker's collateral was worth far more than it really was. That let the attacker borrow and run off with about $130 million.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.