Cream Finance Hack

TOTAL LOST $36.2M
High #155 All-Time Other

Summarize with AI

Affected Chain 2021 Incident surface
Recovered - No recovery reported
All-Time Rank #155 By amount stolen
Protocol Type Dexs Target category

Incident Overview

Cream Finance got exploited through a vulnerability hidden in the borrow() function, which was repeatedly utilized for reentrancy attacks. The attacker made away with approx. $36 million.

Cream (Crypto Rules Everything Around Me) Finance is a decentralized lending protocol designed for institutions, protocols and people in order to access financial services.

The risk for reentrancy arose because of the way $AMP was integrated into the protocol. The $AMP token contract is based on the ERC777 standard, which utilizes the _callPostTransferHooks hook. The attack transactions started with supplying $ETH as a collateral for borrowing $AMP from the crAMP market. When transferring AMP to the attacking contract, the _callPostTransferHooks was called, which in turn triggered the execution of a fallback function in the attack contract allowing the latter to re-enter the crETH market to borrow $ETH against the very same collateral initially supposed to be used for borrowing $AMP.

The flow of an example exploit transaction: https://etherscan.io/tx/0xa9a1b8ea…ffe61e

- The hacker creates contract A to flash loan 500 $WETH and use the funds as collateral on cream, minting 24.17k crETH;

- borrows 19.48M $AMP for the received crETH;

- exploits the reentrancy possibility by repeatedly calling borrow() during the token transfer, taking a further 355 $ETH before the state of the initial borrow() has been updated;

- uses contract B, which receives a half (9.74M) of A's borrowed $AMP;

- contract B liquidates part of A's loan, redeeming 187 $WETH and transferring it back to contract A;

- contract A uses $ETH borrowed via reentrancy to repay the remainder of the flash loan.

The profits of the above explained transaction amounted to 41 $ETH and 9.74M $AMP.

In total, 17 attack transactions were conducted netting the attackers a total of $AMP 462,079,976 and $ETH 2,804.96.

Attack contract A:

https://etherscan.io/address/0x38c40427…0bd22b

Attack contract B:

https://etherscan.io/address/0x0ec306D7…75A125

Exploiter address 1:

https://etherscan.io/address/0xce1f4b4f…ff6ede

Exploiter address 2:

https://etherscan.io/address/0x8036EbD0…6aaF1F

Incident Report

Protocol / Project Cream Finance
Date of Incident
Attack Technique Other
Classification Borrowing and Lending

Protocol Information

Protocol Type Dexs
Affected Token CREAM
Official Website cream.finance/
Protocol Twitter/X @CreamdotFinance
Team Anonymous
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 other and Solidity and EVM internals
Capital Required Seed capital to cover gas and initial position setup
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: 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? Likely — with a thorough Other audit checklist and test coverage

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

  • Verify all logic paths related to Other are guarded by proper access controls and input validation
  • 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

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