Cream Finance Hack

TOTAL LOST $130M
Critical #65 All-Time Flash Loan Attack

Summarize with AI

Affected Chain 2021 Incident surface
Recovered - No recovery reported
All-Time Rank #65 By amount stolen
Auditors 1 Prior security audit

Incident Overview

The flash loan attack happened on CreamFinance for the second time. Funds were stolen for a total of 130,000,000 $USD.

The attacker:

- borrowed $500m DAI from Maker

- deposited to yDAI into yUSD Curve pool (yDAI/yUSDC/yUSDT/yTUSD)

- deposited $500m yUSD into yUSD Yean Vault

- minted $500m cryUSD by depositing minted yUSD Yearn Vault into Cream Finance

- flash borrowed $2b ETH using contract

- minted cETHER by depositing $2b ETH into Cream Finance

- borrowed $500m yUSD Yean Vault by using the $2b ETH as collateral

- minted $500m cryUSD by depositing the $500m yUSD Yean Vault back in Cream Finance

- transferred $500m cryUSD to his address, balance: $1b cryUSD

- borrowed $500m yUSD Yearn Vault by using the $2b ETH collateral

- minted $500m cryUSD by depositing the $500m yUSD Yearn Vault back in Cream Finance

- transferred $500m cryUSD to his address, balance: $1.5b cryUSD

- borrowed $500m yUSD Yearn Vault, debt $1.5b against a $2b collateral

- transferred $500m yUSD Yearn Vault to his address, balance: $1.5b cryUSD and $500m yUSD Yearn Vault

- bought $3m DUSD from Curve

- burnt $3m DUSD for the underlying yUSD Yearn Vault collateral, balance: $1.5b cryUSD and $503m yUSD Yearn Vault

- burnt $503m yUSD Yearn Vault shares for the underlying yUSD tokens, the total supply of yUSD Yearn Vault reduced to $8m

- transferred $8m yUSD to yUSD Yearn Vault. The yUSD balance becomes $16m while the total supply remains $8m. The price of yUSDVault share becomes $2

- contract's debt increased to $3b against $2b collateral

- using $3b of cryUSD collateral on his balance, borrowed $2b ETH

- balance: $2b ETH, $500m yUSD, and $1b in Cream collateral ($3b cryUSD collateral minus $2b ETH debt)

- ETH and yUSD were used to pay back the flash loans and utilize the remaining $1b collateral to drain tokens from Cream Finance

When retrieving the share price of the yUSD pool, Cream's lending pool uses its pricePerShare interface directly, and this interface is supplemented by the contract's collateral balance and the amount of collateral assets in the strategy pool. To calculate the price of a single share, divide the total number of shares by the number of shares outstanding. As a result, by simply moving the collateral to yUSD, the user can easily increase the price of a single share, allowing the collateral in the Cream loan pool to lend more funds.

The attacker's addresses:

https://etherscan.io/address/0x24354d31…cf866b

https://etherscan.io/address/0x921760e7…7fe253

Attacker contract address:

https://etherscan.io/address/0x961d2b69…8a330d

The transaction under the attack:

https://etherscan.io/tx/0x0fe25420…331c92

Incident Report

Protocol / Project Cream Finance
Date of Incident
Attack Technique Flash Loan Attack
Classification Exchange (DEX),Borrowing and Lending

Protocol Information

Protocol Type Dexs
Affected Token CREAM
Official Website cream.finance/
Protocol Twitter/X @CreamdotFinance
Team Public / Doxxed
Source Code Unverified

Market Context at Time of Hack

Token Categories
DeFi DAO Ethereum Ecosystem AMM Yearn Partnerships Governance Solana Ecosystem Lending & Borrowing

What the Attacker Needed to Succeed

Understanding the prerequisites for this type of attack helps auditors identify protocols that are most at risk and helps developers build better defenses.

Technical Knowledge Deep understanding of flash loan attack and Solidity and EVM internals
Capital Required Flash loan capital (borrowed atomically, zero upfront cost)
On-Chain Access Ability to interact with smart contracts and deploy a custom exploit contract
Protocol Analysis Identification of the exploitable vulnerability in Cream Finance's contract logic - root cause: exchange (dex),borrowing and lending
Execution Speed Precise transaction ordering and timing to exploit the vulnerability within a single atomic block
Obfuscation Plan A strategy to launder and move stolen funds - typically through mixers, cross-chain bridges, or decentralized DEX swaps to resist tracing

What Auditors Should Check

Could this have been caught in audit? Yes — skilled auditors routinely flag Flash Loan Attack vulnerabilities in code review
Audited by Trail of Bits — still lost $130M. Prior audits don't guarantee safety, especially after post-audit code changes.

If you're auditing a protocol with similar architecture to Cream Finance, these are the critical security checks that could have prevented this incident (October 2021).

  • Verify all logic paths related to Flash Loan Attack are guarded by proper access controls and input validation - see the Flash Loans Attacks attack class for patterns
  • Review privileged functions (owner, admin, governance) for potential abuse vectors - centralization risks should be documented and bounded with timelocks or multi-sigs

Master these auditing techniques with hands-on labs and real exploit scenarios in the Smart Contract Hacking course.

Free Trial

Security Audit History

Post-Incident Timeline

  • 2022-09-12

    1000 $ETH was swapped for 80 $BTC and bridged using REN protocol from the attacker's second address

  • 2023-03-23

    The Cream Finance team tweeted about their thoughts and findings about the exploited funds. They firmly believe that TradeOgre DEX is actively complicit in laundering the exploited funds for the exploiter, said in the tweet.

Related Attack Classes

The technique used in this hack maps to these vulnerability classes in our security curriculum:

See all Flash Loans Attacks examples →

Sources & References

Learn to Prevent the Next Cream Finance

The Cream Finance hack is one of many attacks that skilled auditors are trained to detect before deployment. Master real exploit patterns and defense techniques with hands-on Web3 security training.

Recreate exploit patterns safely Free Trial